aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-09-08 21:35:54 -0700
committerJunio C Hamano <gitster@pobox.com>2016-09-08 21:35:54 -0700
commit69307312d1bee69d33151cee8ed5940c46d7ee39 (patch)
tree8c7ed3be35ac5d44c394c8e1aa2234265464849e /t
parent86df11b1a46dd9c3e383b02d21f17d9329aff6e0 (diff)
parent5447a76aad4074c31e7c8a6299cc586435f385e9 (diff)
downloadgit-69307312d1bee69d33151cee8ed5940c46d7ee39.tar.gz
git-69307312d1bee69d33151cee8ed5940c46d7ee39.tar.xz
Merge branch 'rs/pull-signed-tag' into maint
When "git merge-recursive" works on history with many criss-cross merges in "verbose" mode, the names the command assigns to the virtual merge bases could have overwritten each other by unintended reuse of the same piece of memory. * rs/pull-signed-tag: commit: use FLEX_ARRAY in struct merge_remote_desc merge-recursive: fix verbose output for multiple base trees commit: factor out set_merge_remote_desc() commit: use xstrdup() in get_merge_parent()
Diffstat (limited to 't')
-rwxr-xr-xt/t3030-merge-recursive.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh
index f7b0e599f..470f33466 100755
--- a/t/t3030-merge-recursive.sh
+++ b/t/t3030-merge-recursive.sh
@@ -660,4 +660,22 @@ test_expect_success 'merging with triple rename across D/F conflict' '
git merge other
'
+test_expect_success 'merge-recursive remembers the names of all base trees' '
+ git reset --hard HEAD &&
+
+ # more trees than static slots used by oid_to_hex()
+ for commit in $c0 $c2 $c4 $c5 $c6 $c7
+ do
+ git rev-parse "$commit^{tree}"
+ done >trees &&
+
+ # ignore the return code -- it only fails because the input is weird
+ test_must_fail git -c merge.verbosity=5 merge-recursive $(cat trees) -- $c1 $c3 >out &&
+
+ # merge-recursive prints in reverse order, but we do not care
+ sort <trees >expect &&
+ sed -n "s/^virtual //p" out | sort >actual &&
+ test_cmp expect actual
+'
+
test_done