summaryrefslogtreecommitdiff
path: root/t/t0090-cache-tree.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t0090-cache-tree.sh')
-rwxr-xr-xt/t0090-cache-tree.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh
index 0c61268..596e269 100755
--- a/t/t0090-cache-tree.sh
+++ b/t/t0090-cache-tree.sh
@@ -161,6 +161,24 @@ test_expect_success PERL 'commit --interactive gives cache-tree on partial commi
test_cache_tree
'
+test_expect_success PERL 'commit -p with shrinking cache-tree' '
+ mkdir -p deep/subdir &&
+ echo content >deep/subdir/file &&
+ git add deep &&
+ git commit -m add &&
+ git rm -r deep &&
+
+ before=$(wc -c <.git/index) &&
+ git commit -m delete -p &&
+ after=$(wc -c <.git/index) &&
+
+ # double check that the index shrank
+ test $before -gt $after &&
+
+ # and that our index was not corrupted
+ git fsck
+'
+
test_expect_success 'commit in child dir has cache-tree' '
mkdir dir &&
>dir/child.t &&