summaryrefslogtreecommitdiff
path: root/t/t1003-read-tree-prefix.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-03-17 00:53:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-03-17 00:53:08 (GMT)
commit190f9bf62a17ca6f97dee3f3818450ab2927215b (patch)
tree9535db8aff0d4abc101106628ab25be60aa7ac07 /t/t1003-read-tree-prefix.sh
parent430883a70c79614e52279f2800a9a383ffc68fe5 (diff)
parentf27c170f645e6b8ed642c49c503964893ee26a4f (diff)
downloadgit-190f9bf62a17ca6f97dee3f3818450ab2927215b.zip
git-190f9bf62a17ca6f97dee3f3818450ab2927215b.tar.gz
git-190f9bf62a17ca6f97dee3f3818450ab2927215b.tar.bz2
Merge branch 'vd/sparse-read-tree'
"git read-tree" has been made to be aware of the sparse-index feature. * vd/sparse-read-tree: read-tree: make three-way merge sparse-aware read-tree: make two-way merge sparse-aware read-tree: narrow scope of index expansion for '--prefix' read-tree: integrate with sparse index read-tree: expand sparse checkout test coverage read-tree: explicitly disallow prefixes with a leading '/' status: fix nested sparse directory diff in sparse index sparse-index: prevent repo root from becoming sparse
Diffstat (limited to 't/t1003-read-tree-prefix.sh')
-rwxr-xr-xt/t1003-read-tree-prefix.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t1003-read-tree-prefix.sh b/t/t1003-read-tree-prefix.sh
index e0db206..c860c08 100755
--- a/t/t1003-read-tree-prefix.sh
+++ b/t/t1003-read-tree-prefix.sh
@@ -25,4 +25,14 @@ test_expect_success 'read-tree --prefix' '
cmp expect actual
'
+test_expect_success 'read-tree --prefix with leading slash exits with error' '
+ git rm -rf . &&
+ test_must_fail git read-tree --prefix=/two/ $tree &&
+ git read-tree --prefix=two/ $tree &&
+
+ git rm -rf . &&
+ test_must_fail git read-tree --prefix=/ $tree &&
+ git read-tree --prefix= $tree
+'
+
test_done