Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-06-18 07:54:02 +0300
committerJunio C Hamano <gitster@pobox.com>2020-06-18 07:54:02 +0300
commita554228ffb417b75c4ab586f084079ac98665c1a (patch)
treed7a60ea07d487d719e74dc50f613cd17853ae8fc /t/t1091-sparse-checkout-builtin.sh
parent524caf80358b1158c40d1947e61d576c8a0c0a8c (diff)
parentb5bfc08a972da3dba0ab19e3252b1cbbef90777b (diff)
Merge branch 'en/sparse-checkout'
The behaviour of "sparse-checkout" in the state "git clone --no-checkout" left was changed accidentally in 2.27, which has been corrected. * en/sparse-checkout: sparse-checkout: avoid staging deletions of all files
Diffstat (limited to 't/t1091-sparse-checkout-builtin.sh')
-rwxr-xr-xt/t1091-sparse-checkout-builtin.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh
index 88cdde255c..7cd45fc139 100755
--- a/t/t1091-sparse-checkout-builtin.sh
+++ b/t/t1091-sparse-checkout-builtin.sh
@@ -100,6 +100,28 @@ test_expect_success 'clone --sparse' '
check_files clone a
'
+test_expect_success 'interaction with clone --no-checkout (unborn index)' '
+ git clone --no-checkout "file://$(pwd)/repo" clone_no_checkout &&
+ git -C clone_no_checkout sparse-checkout init --cone &&
+ git -C clone_no_checkout sparse-checkout set folder1 &&
+
+ git -C clone_no_checkout sparse-checkout list >actual &&
+ cat >expect <<-\EOF &&
+ folder1
+ EOF
+ test_cmp expect actual &&
+
+ # nothing checked out, expect "No such file or directory"
+ ! ls clone_no_checkout/* >actual &&
+ test_must_be_empty actual &&
+ test_path_is_missing clone_no_checkout/.git/index &&
+
+ # No branch is checked out until we manually switch to one
+ git -C clone_no_checkout switch master &&
+ test_path_is_file clone_no_checkout/.git/index &&
+ check_files clone_no_checkout a folder1
+'
+
test_expect_success 'set enables config' '
git init empty-config &&
(