pull --rebase: error on no merge candidate cases

Tweak the error messages printed by die_no_merge_candidates() to take into account that we may be "rebasing against" rather than "merging with". Signed-off-by: Paul Tan <pyokagan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Paul Tan committed Jun 18, 2015 at 18:54 UTC b7b314711ad28b129e6c5916eee1f2036ffa94df
1 file changed +12 -3
builtin/pull.c
+12 -3
@@ -431,7 +431,10 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs
431 const char *remote = curr_branch ? curr_branch->remote_name : NULL;
432
433 if (*refspecs) {
434 - fprintf_ln(stderr, _("There are no candidates for merging among the refs that you just fetched."));
434 + if (opt_rebase)
435 + fprintf_ln(stderr, _("There is no candidate for rebasing against among the refs that you just fetched."));
436 + else
437 + fprintf_ln(stderr, _("There are no candidates for merging among the refs that you just fetched."));
438 fprintf_ln(stderr, _("Generally this means that you provided a wildcard refspec which had no\n"
439 "matches on the remote end."));
440 } else if (repo && curr_branch && (!remote || strcmp(repo, remote))) {
@@ -441,7 +444,10 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs
444 repo);
445 } else if (!curr_branch) {
446 fprintf_ln(stderr, _("You are not currently on a branch."));
444 - fprintf_ln(stderr, _("Please specify which branch you want to merge with."));
447 + if (opt_rebase)
448 + fprintf_ln(stderr, _("Please specify which branch you want to rebase against."));
449 + else
450 + fprintf_ln(stderr, _("Please specify which branch you want to merge with."));
451 fprintf_ln(stderr, _("See git-pull(1) for details."));
452 fprintf(stderr, "\n");
453 fprintf_ln(stderr, " git pull <remote> <branch>");
@@ -453,7 +459,10 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs
459 remote_name = "<remote>";
460
461 fprintf_ln(stderr, _("There is no tracking information for the current branch."));
456 - fprintf_ln(stderr, _("Please specify which branch you want to merge with."));
462 + if (opt_rebase)
463 + fprintf_ln(stderr, _("Please specify which branch you want to rebase against."));
464 + else
465 + fprintf_ln(stderr, _("Please specify which branch you want to merge with."));
466 fprintf_ln(stderr, _("See git-pull(1) for details."));
467 fprintf(stderr, "\n");
468 fprintf_ln(stderr, " git pull <remote> <branch>");