Skip to content

Commit b7b3147

Browse files
pyokagangitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8944969 commit b7b3147

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

builtin/pull.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,10 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs
431431
const char *remote = curr_branch ? curr_branch->remote_name : NULL;
432432

433433
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."));
435438
fprintf_ln(stderr, _("Generally this means that you provided a wildcard refspec which had no\n"
436439
"matches on the remote end."));
437440
} 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
441444
repo);
442445
} else if (!curr_branch) {
443446
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."));
445451
fprintf_ln(stderr, _("See git-pull(1) for details."));
446452
fprintf(stderr, "\n");
447453
fprintf_ln(stderr, " git pull <remote> <branch>");
@@ -453,7 +459,10 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs
453459
remote_name = "<remote>";
454460

455461
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."));
457466
fprintf_ln(stderr, _("See git-pull(1) for details."));
458467
fprintf(stderr, "\n");
459468
fprintf_ln(stderr, " git pull <remote> <branch>");

0 commit comments

Comments
 (0)