diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-05-08 14:25:06 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-05-08 14:25:06 -0700 |
commit | e9acbd68366ae26834a1f8d0801647a7e6de9500 (patch) | |
tree | 8fe0c14d6fc43d45e3492c32df722d1e15d0795a /t | |
parent | Merge branch 'jt/commit-graph-plug-memleak' (diff) | |
parent | sparse-checkout: stop blocking empty workdirs (diff) | |
download | tgif-e9acbd68366ae26834a1f8d0801647a7e6de9500.tar.xz |
Merge branch 'ds/sparse-allow-empty-working-tree'
The sparse-checkout patterns have been forbidden from excluding all
paths, leaving an empty working tree, for a long time. This
limitation has been lifted.
* ds/sparse-allow-empty-working-tree:
sparse-checkout: stop blocking empty workdirs
Diffstat (limited to 't')
-rwxr-xr-x | t/t1011-read-tree-sparse-checkout.sh | 12 | ||||
-rwxr-xr-x | t/t1091-sparse-checkout-builtin.sh | 8 |
2 files changed, 12 insertions, 8 deletions
diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh index 63223e13bd..140f459977 100755 --- a/t/t1011-read-tree-sparse-checkout.sh +++ b/t/t1011-read-tree-sparse-checkout.sh @@ -74,13 +74,19 @@ test_expect_success 'read-tree --no-sparse-checkout with empty .git/info/sparse- test_expect_success 'read-tree with empty .git/info/sparse-checkout' ' git config core.sparsecheckout true && echo >.git/info/sparse-checkout && - read_tree_u_must_fail -m -u HEAD && + read_tree_u_must_succeed -m -u HEAD && git ls-files --stage >result && test_cmp expected result && git ls-files -t >result && + cat >expected.swt <<-\EOF && + S init.t + S sub/added + S sub/addedtoo + S subsub/added + EOF test_cmp expected.swt result && - test -f init.t && - test -f sub/added + ! test -f init.t && + ! test -f sub/added ' test_expect_success 'match directories with trailing slash' ' diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh index dee99eeec3..88cdde255c 100755 --- a/t/t1091-sparse-checkout-builtin.sh +++ b/t/t1091-sparse-checkout-builtin.sh @@ -106,10 +106,8 @@ test_expect_success 'set enables config' ' cd empty-config && test_commit test file && test_path_is_missing .git/config.worktree && - test_must_fail git sparse-checkout set nothing && + git sparse-checkout set nothing && test_path_is_file .git/config.worktree && - test_must_fail git config core.sparseCheckout && - git sparse-checkout set "/*" && test_cmp_config true core.sparseCheckout ) ' @@ -302,8 +300,8 @@ test_expect_success 'revert to old sparse-checkout on empty update' ' echo >file && git add file && git commit -m "test" && - test_must_fail git sparse-checkout set nothing 2>err && - test_i18ngrep "Sparse checkout leaves no entry on working directory" err && + git sparse-checkout set nothing 2>err && + test_i18ngrep ! "Sparse checkout leaves no entry on working directory" err && test_i18ngrep ! ".git/index.lock" err && git sparse-checkout set file ) |