test-path-utils: handle const parameter of basename and dirname
[gitweb.git] / t / t3030-merge-recursive.sh
index 6224187632b105edf1940023eba4a49523d92fe2..9a893b5fe746f03521454972199ecb2d243d79ab 100755 (executable)
@@ -263,7 +263,7 @@ test_expect_success 'setup 8' '
        test_ln_s_add e a &&
        test_tick &&
        git commit -m "rename a->e, symlink a->e" &&
-       oln=`printf e | git hash-object --stdin`
+       oln=$(printf e | git hash-object --stdin)
 '
 
 test_expect_success 'setup 9' '
@@ -575,13 +575,13 @@ test_expect_success 'merge removes empty directories' '
        test_must_fail test -d d
 '
 
-test_expect_failure 'merge-recursive simple w/submodule' '
+test_expect_success 'merge-recursive simple w/submodule' '
 
        git checkout submod &&
        git merge remove
 '
 
-test_expect_failure 'merge-recursive simple w/submodule result' '
+test_expect_success 'merge-recursive simple w/submodule result' '
 
        git ls-files -s >actual &&
        (
@@ -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