X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=t%2Ft1091-sparse-checkout-builtin.sh;h=7cd45fc13946b35af307c7735c7ecd8a1ae52563;hb=12f5eb9f082d7f4cb083a11aa59ac8bbd5e1589a;hp=88cdde255cdad7a0b138033b3ff9a997e4a2c0b2;hpb=a2a0942a16a6459d4a52e7ee4ec85f7f90ad5334;p=thirdparty%2Fgit.git 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 && (