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.sh22
1 files changed, 20 insertions, 2 deletions
diff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh
index 0c61268..94fcb4a 100755
--- a/t/t0090-cache-tree.sh
+++ b/t/t0090-cache-tree.sh
@@ -156,11 +156,29 @@ test_expect_success PERL 'commit --interactive gives cache-tree on partial commi
return 44;
}
EOT
- (echo p; echo 1; echo; echo s; echo n; echo y; echo q) |
+ test_write_lines p 1 "" s n y q |
git commit --interactive -m foo &&
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 &&
@@ -239,7 +257,7 @@ test_expect_success 'no phantom error when switching trees' '
>newdir/one &&
git add newdir/one &&
git checkout 2>errors &&
- ! test -s errors
+ test_must_be_empty errors
'
test_expect_success 'switching trees does not invalidate shared index' '