Skip to content

Commit

Permalink
merge: simplify code flow
Browse files Browse the repository at this point in the history
One of the first things cmd_merge() does is to see if the "--abort"
option is given and run "reset --merge" and exit.  When the control
reaches this point, we know "--abort" was not given.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Apr 29, 2015
1 parent 9e62316 commit 00c7e7e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions builtin/merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1165,15 +1165,15 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
option_commit = 0;
}

if (!abort_current_merge) {
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) {
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)
usage_with_options(builtin_merge_usage,
builtin_merge_options);
Expand Down

0 comments on commit 00c7e7e

Please sign in to comment.