summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-08-19 22:34:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-08-19 22:34:14 (GMT)
commitaeb1b7f55d5db4eda968de5eb27f04d42df9edc1 (patch)
treefdea1fcbbbb3837bb82b38dc0d578c46020c0c4c /t
parentd63263a4dee8fc7da9b97bbdedf9c0d1f33024d4 (diff)
parent5447a76aad4074c31e7c8a6299cc586435f385e9 (diff)
downloadgit-aeb1b7f55d5db4eda968de5eb27f04d42df9edc1.zip
git-aeb1b7f55d5db4eda968de5eb27f04d42df9edc1.tar.gz
git-aeb1b7f55d5db4eda968de5eb27f04d42df9edc1.tar.bz2
Merge branch 'rs/pull-signed-tag'
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 f7b0e59..470f334 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