Browse Source

Merge branch 'cb/maint-no-double-merge'

* cb/maint-no-double-merge:
  refuse to merge during a merge
maint
Junio C Hamano 16 years ago
parent
commit
0a17b2cd7e
  1. 5
      builtin-merge.c
  2. 3
      t/t3030-merge-recursive.sh

5
builtin-merge.c

@ -836,8 +836,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix) @@ -836,8 +836,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
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

3
t/t3030-merge-recursive.sh

@ -276,6 +276,9 @@ test_expect_success 'fail if the index has unresolved entries' ' @@ -276,6 +276,9 @@ test_expect_success 'fail if the index has unresolved entries' '

test_must_fail git merge "$c5" &&
test_must_fail git merge "$c5" 2> out &&
grep "You have not concluded your merge" out &&
rm -f .git/MERGE_HEAD &&
test_must_fail git merge "$c5" 2> out &&
grep "You are in the middle of a conflicted merge" out

'

Loading…
Cancel
Save