Skip to content

Commit

Permalink
Merge branch 'vr/git-merge-default-to-upstream'
Browse files Browse the repository at this point in the history
* vr/git-merge-default-to-upstream:
  Show error for 'git merge' with unset merge.defaultToUpstream
  • Loading branch information
Junio C Hamano committed Dec 5, 2011
2 parents cddec4f + 5480207 commit ce8781e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions builtin/merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,9 +1169,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
die(_("You cannot combine --no-ff with --ff-only."));

if (!abort_current_merge) {
if (!argc && default_to_upstream)
argc = setup_with_upstream(&argv);
else if (argc == 1 && !strcmp(argv[0], "-"))
if (!argc) {
if (default_to_upstream)
argc = setup_with_upstream(&argv);
else
die(_("No commit specified and merge.defaultToUpstream not set."));
} else if (argc == 1 && !strcmp(argv[0], "-"))
argv[0] = "@{-1}";
}
if (!argc)
Expand Down

0 comments on commit ce8781e

Please sign in to comment.