summaryrefslogtreecommitdiff
path: root/t/t7600-merge.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-07-14 00:09:41 -0700
committerJunio C Hamano <gitster@pobox.com>2008-07-14 00:09:41 -0700
commit711f6b295cf463aae07eb76e009faed3d3699623 (patch)
tree7acf1583cb4daad2293415d996517e1164852c7d /t/t7600-merge.sh
parent3d1dd4728b83e4c08d9fa7aaf2aa946e1012e061 (diff)
downloadgit-711f6b295cf463aae07eb76e009faed3d3699623.tar.gz
reduce_heads(): protect from duplicate input
Because we do not try computing merge base with itself for obvious reasons, the code was not prepared for an arguably insane case of the caller feeding the same commit twice to it. Noticed and test written by Sverre Hvammen Johansen Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7600-merge.sh')
-rwxr-xr-xt/t7600-merge.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index f035ea376e..d4cf6289a4 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -490,4 +490,26 @@ test_expect_success 'merge c1 with c0, c2, c0, and c1' '
test_debug 'gitk --all'
+test_expect_success 'merge c1 with c0, c2, c0, and c1' '
+ git reset --hard c1 &&
+ git config branch.master.mergeoptions "" &&
+ test_tick &&
+ git merge c0 c2 c0 c1 &&
+ verify_merge file result.1-5 &&
+ verify_parents $c1 $c2
+'
+
+test_debug 'gitk --all'
+
+test_expect_success 'merge c1 with c1 and c2' '
+ git reset --hard c1 &&
+ git config branch.master.mergeoptions "" &&
+ test_tick &&
+ git merge c1 c2 &&
+ verify_merge file result.1-5 &&
+ verify_parents $c1 $c2
+'
+
+test_debug 'gitk --all'
+
test_done