aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/perf/p2000-sparse-operations.sh1
-rwxr-xr-xt/t1092-sparse-checkout-compatibility.sh20
2 files changed, 18 insertions, 3 deletions
diff --git a/t/perf/p2000-sparse-operations.sh b/t/perf/p2000-sparse-operations.sh
index c181110a43..fce8151d41 100755
--- a/t/perf/p2000-sparse-operations.sh
+++ b/t/perf/p2000-sparse-operations.sh
@@ -123,5 +123,6 @@ test_perf_on_all git blame $SPARSE_CONE/f3/a
test_perf_on_all git read-tree -mu HEAD
test_perf_on_all git checkout-index -f --all
test_perf_on_all git update-index --add --remove $SPARSE_CONE/a
+test_perf_on_all "git rm -f $SPARSE_CONE/a && git checkout HEAD -- $SPARSE_CONE/a"
test_done
diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh
index 85247bb15f..a6a14c8a21 100755
--- a/t/t1092-sparse-checkout-compatibility.sh
+++ b/t/t1092-sparse-checkout-compatibility.sh
@@ -937,7 +937,7 @@ test_expect_success 'read-tree --prefix' '
test_all_match git read-tree --prefix=deep/deeper1/deepest -u deepest &&
test_all_match git status --porcelain=v2 &&
- test_all_match git rm -rf --sparse folder1/ &&
+ run_on_all git rm -rf --sparse folder1/ &&
test_all_match git read-tree --prefix=folder1/ -u update-folder1 &&
test_all_match git status --porcelain=v2 &&
@@ -1899,7 +1899,7 @@ test_expect_success 'rm pathspec inside sparse definition' '
test_all_match git status --porcelain=v2
'
-test_expect_failure 'rm pathspec outside sparse definition' '
+test_expect_success 'rm pathspec outside sparse definition' '
init_repos &&
for file in folder1/a folder1/0/1
@@ -1939,7 +1939,7 @@ test_expect_failure 'rm pathspec outside sparse definition' '
test_sparse_match git status --porcelain=v2
'
-test_expect_failure 'rm pathspec expands index when necessary' '
+test_expect_success 'rm pathspec expands index when necessary' '
init_repos &&
# in-cone pathspec (do not expand)
@@ -1958,4 +1958,18 @@ test_expect_failure 'rm pathspec expands index when necessary' '
test_must_be_empty sparse-index-err
'
+test_expect_success 'sparse index is not expanded: rm' '
+ init_repos &&
+
+ ensure_not_expanded rm deep/a &&
+
+ # test in-cone wildcard
+ git -C sparse-index reset --hard &&
+ ensure_not_expanded rm deep/* &&
+
+ # test recursive rm
+ git -C sparse-index reset --hard &&
+ ensure_not_expanded rm -r deep
+'
+
test_done