cache-tree: create/update cache-tree on checkout
[gitweb.git] / t / t0090-cache-tree.sh
index 6c33e28ee8df4d239dd6d1c1d98c324b01c70ed3..98fb1ab6daab92ffd54f7ce82bccd4d10896def9 100755 (executable)
@@ -44,14 +44,14 @@ test_expect_success 'read-tree HEAD establishes cache-tree' '
 
 test_expect_success 'git-add invalidates cache-tree' '
        test_when_finished "git reset --hard; git read-tree HEAD" &&
-       echo "I changed this file" > foo &&
+       echo "I changed this file" >foo &&
        git add foo &&
        test_invalid_cache_tree
 '
 
 test_expect_success 'update-index invalidates cache-tree' '
        test_when_finished "git reset --hard; git read-tree HEAD" &&
-       echo "I changed this file" > foo &&
+       echo "I changed this file" >foo &&
        git update-index --add foo &&
        test_invalid_cache_tree
 '
@@ -85,9 +85,22 @@ test_expect_success 'reset --hard without index gives cache-tree' '
        test_shallow_cache_tree
 '
 
-test_expect_failure 'checkout gives cache-tree' '
+test_expect_success 'checkout gives cache-tree' '
+       git tag current &&
        git checkout HEAD^ &&
        test_shallow_cache_tree
 '
 
+test_expect_success 'checkout -b gives cache-tree' '
+       git checkout current &&
+       git checkout -b prev HEAD^ &&
+       test_shallow_cache_tree
+'
+
+test_expect_success 'checkout -B gives cache-tree' '
+       git checkout current &&
+       git checkout -B prev HEAD^ &&
+       test_shallow_cache_tree
+'
+
 test_done