Merge branch 'cb/maint-no-double-merge'
authorJunio C Hamano <gitster@pobox.com>
Sat, 13 Jun 2009 19:50:22 +0000 (12:50 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 13 Jun 2009 19:50:22 +0000 (12:50 -0700)
* cb/maint-no-double-merge:
refuse to merge during a merge

1  2 
builtin-merge.c
diff --combined builtin-merge.c
index 8d101eff0b433bd5afa6cf1e027e50447fdf5370,9e9bd526c39e25b257733a575e8c690ed494f214..793f2f4a189e448fb481c5c1e2886be28fddf2e2
@@@ -462,7 -462,7 +462,7 @@@ static int git_merge_config(const char 
                argv = xrealloc(argv, sizeof(*argv) * (argc + 2));
                memmove(argv + 1, argv, sizeof(*argv) * (argc + 1));
                argc++;
 -              parse_options(argc, argv, builtin_merge_options,
 +              parse_options(argc, argv, NULL, builtin_merge_options,
                              builtin_merge_usage, 0);
                free(buf);
        }
@@@ -836,8 -836,11 +836,11 @@@ int cmd_merge(int argc, const char **ar
        struct commit_list **remotes = &remoteheads;
  
        setup_work_tree();
+       if (file_exists(git_path("MERGE_HEAD")))
+               die("You have not concluded your merge. (MERGE_HEAD exists)");
        if (read_cache_unmerged())
-               die("You are in the middle of a conflicted merge.");
+               die("You are in the middle of a conflicted merge."
+                               " (index unmerged)");
  
        /*
         * Check if we are _not_ on a detached HEAD, i.e. if there is a
        if (diff_use_color_default == -1)
                diff_use_color_default = git_use_color_default;
  
 -      argc = parse_options(argc, argv, builtin_merge_options,
 +      argc = parse_options(argc, argv, prefix, builtin_merge_options,
                        builtin_merge_usage, 0);
        if (verbosity < 0)
                show_diffstat = 0;