summaryrefslogtreecommitdiff
path: root/t/t7600-merge.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-30 20:07:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-10-30 20:07:08 (GMT)
commit54bc41416c5d3ecb978acb0df80d57aa3e54494c (patch)
treea804b8e346b9f79bc461cdb52686d805ff69d535 /t/t7600-merge.sh
parentf60b5dc68cdb7a75e148c5b98238a880363cf870 (diff)
parente34f80278e920e53b69016c7cecb24e4621e4564 (diff)
downloadgit-54bc41416c5d3ecb978acb0df80d57aa3e54494c.zip
git-54bc41416c5d3ecb978acb0df80d57aa3e54494c.tar.gz
git-54bc41416c5d3ecb978acb0df80d57aa3e54494c.tar.bz2
Merge branch 'jk/merge-file-exit-code'
"git merge-file" tried to signal how many conflicts it found, which obviously would not work well when there are too many of them. * jk/merge-file-exit-code: merge-file: clamp exit code to maximum 127
Diffstat (limited to 't/t7600-merge.sh')
-rwxr-xr-xt/t7600-merge.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 75c50ee..302e238 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -692,4 +692,37 @@ test_expect_success GPG 'merge --no-edit tag should skip editor' '
test_cmp actual expect
'
+test_expect_success 'set up mod-256 conflict scenario' '
+ # 256 near-identical stanzas...
+ for i in $(test_seq 1 256); do
+ for j in 1 2 3 4 5; do
+ echo $i-$j
+ done
+ done >file &&
+ git add file &&
+ git commit -m base &&
+
+ # one side changes the first line of each to "master"
+ sed s/-1/-master/ <file >tmp &&
+ mv tmp file &&
+ git commit -am master &&
+
+ # and the other to "side"; merging the two will
+ # yield 256 separate conflicts
+ git checkout -b side HEAD^ &&
+ sed s/-1/-side/ <file >tmp &&
+ mv tmp file &&
+ git commit -am side
+'
+
+test_expect_success 'merge detects mod-256 conflicts (recursive)' '
+ git reset --hard &&
+ test_must_fail git merge -s recursive master
+'
+
+test_expect_success 'merge detects mod-256 conflicts (resolve)' '
+ git reset --hard &&
+ test_must_fail git merge -s resolve master
+'
+
test_done