Skip to content

Commit ce8781e

Browse files
committed
Merge branch 'vr/git-merge-default-to-upstream'
* vr/git-merge-default-to-upstream: Show error for 'git merge' with unset merge.defaultToUpstream
2 parents cddec4f + 5480207 commit ce8781e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

builtin/merge.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,9 +1169,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
11691169
die(_("You cannot combine --no-ff with --ff-only."));
11701170

11711171
if (!abort_current_merge) {
1172-
if (!argc && default_to_upstream)
1173-
argc = setup_with_upstream(&argv);
1174-
else if (argc == 1 && !strcmp(argv[0], "-"))
1172+
if (!argc) {
1173+
if (default_to_upstream)
1174+
argc = setup_with_upstream(&argv);
1175+
else
1176+
die(_("No commit specified and merge.defaultToUpstream not set."));
1177+
} else if (argc == 1 && !strcmp(argv[0], "-"))
11751178
argv[0] = "@{-1}";
11761179
}
11771180
if (!argc)

0 commit comments

Comments
 (0)