summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/t1091-sparse-checkout-builtin.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh
index 1ed003ac1d..fbd46c3f61 100755
--- a/t/t1091-sparse-checkout-builtin.sh
+++ b/t/t1091-sparse-checkout-builtin.sh
@@ -186,4 +186,55 @@ test_expect_success 'sparse-checkout disable' '
test_cmp expect dir
'
+test_expect_success 'cone mode: init and set' '
+ git -C repo sparse-checkout init --cone &&
+ git -C repo config --list >config &&
+ test_i18ngrep "core.sparsecheckoutcone=true" config &&
+ ls repo >dir &&
+ echo a >expect &&
+ test_cmp expect dir &&
+ git -C repo sparse-checkout set deep/deeper1/deepest/ 2>err &&
+ test_must_be_empty err &&
+ ls repo >dir &&
+ cat >expect <<-EOF &&
+ a
+ deep
+ EOF
+ test_cmp expect dir &&
+ ls repo/deep >dir &&
+ cat >expect <<-EOF &&
+ a
+ deeper1
+ EOF
+ test_cmp expect dir &&
+ ls repo/deep/deeper1 >dir &&
+ cat >expect <<-EOF &&
+ a
+ deepest
+ EOF
+ test_cmp expect dir &&
+ cat >expect <<-EOF &&
+ /*
+ !/*/
+ /deep/
+ !/deep/*/
+ /deep/deeper1/
+ !/deep/deeper1/*/
+ /deep/deeper1/deepest/
+ EOF
+ test_cmp expect repo/.git/info/sparse-checkout &&
+ git -C repo sparse-checkout set --stdin 2>err <<-EOF &&
+ folder1
+ folder2
+ EOF
+ test_must_be_empty err &&
+ cat >expect <<-EOF &&
+ a
+ folder1
+ folder2
+ EOF
+ ls repo >dir &&
+ test_cmp expect dir
+'
+
test_done