]> granicus.if.org Git - git/commitdiff
merge: simplify code flow
authorJunio C Hamano <gitster@pobox.com>
Thu, 23 Apr 2015 20:01:44 +0000 (13:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 29 Apr 2015 20:17:52 +0000 (13:17 -0700)
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>
builtin/merge.c

index bebbe5b3081ebe2602abaf0dc9508a1342f01086..8477878442c3907169870e9a3986aaddd54b872d 100644 (file)
@@ -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);