Merge branch 'sb/pack-protocol-doc-nak' into maint
[gitweb.git] / t / t2203-add-intent.sh
index 2a4a749b4fa3b07963a18b645d29ef774c01bbd1..8f22c43e245cb6fb68449a64ba45222e187f56a9 100755 (executable)
@@ -82,5 +82,36 @@ test_expect_success 'cache-tree invalidates i-t-a paths' '
        test_cmp expect actual
 '
 
+test_expect_success 'cache-tree does not ignore dir that has i-t-a entries' '
+       git init ita-in-dir &&
+       (
+               cd ita-in-dir &&
+               mkdir 2 &&
+               for f in 1 2/1 2/2 3
+               do
+                       echo "$f" >"$f"
+               done &&
+               git add 1 2/2 3 &&
+               git add -N 2/1 &&
+               git commit -m committed &&
+               git ls-tree -r HEAD >actual &&
+               grep 2/2 actual
+       )
+'
+
+test_expect_success 'cache-tree does skip dir that becomes empty' '
+       rm -fr ita-in-dir &&
+       git init ita-in-dir &&
+       (
+               cd ita-in-dir &&
+               mkdir -p 1/2/3 &&
+               echo 4 >1/2/3/4 &&
+               git add -N 1/2/3/4 &&
+               git write-tree >actual &&
+               echo $EMPTY_TREE >expected &&
+               test_cmp expected actual
+       )
+'
+
 test_done