From: Junio C Hamano Date: Fri, 25 Feb 2022 23:47:33 +0000 (-0800) Subject: Merge branch 'ds/sparse-checkout-requires-per-worktree-config' X-Git-Tag: v2.36.0-rc0~114 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6249ce2d1b9b60e7aa630d370e68c87ef6331629;p=thirdparty%2Fgit.git Merge branch 'ds/sparse-checkout-requires-per-worktree-config' "git sparse-checkout" wants to work with per-worktree configuration, but did not work well in a worktree attached to a bare repository. * ds/sparse-checkout-requires-per-worktree-config: config: make git_configset_get_string_tmp() private worktree: copy sparse-checkout patterns and config on add sparse-checkout: set worktree-config correctly config: add repo_config_set_worktree_gently() worktree: create init_worktree_config() Documentation: add extensions.worktreeConfig details --- 6249ce2d1b9b60e7aa630d370e68c87ef6331629 diff --cc t/t1091-sparse-checkout-builtin.sh index 3592d12442,8a757b43e6..502d42d183 --- a/t/t1091-sparse-checkout-builtin.sh +++ b/t/t1091-sparse-checkout-builtin.sh @@@ -237,31 -243,36 +252,31 @@@ test_expect_success 'sparse-checkout di ' test_expect_success 'sparse-index enabled and disabled' ' - ( - sane_unset GIT_TEST_SPLIT_INDEX && - git -C repo update-index --no-split-index && - - git -C repo sparse-checkout init --cone --sparse-index && - test_cmp_config -C repo true index.sparse && - git -C repo ls-files --sparse >sparse && - git -C repo sparse-checkout disable && - git -C repo ls-files --sparse >full && - - cat >expect <<-\EOF && - @@ -1,4 +1,7 @@ - a - -deep/ - -folder1/ - -folder2/ - +deep/a - +deep/deeper1/a - +deep/deeper1/deepest/a - +deep/deeper2/a - +folder1/a - +folder2/a - EOF - - diff -u sparse full | tail -n +3 >actual && - test_cmp expect actual && - - git -C repo config --list >config && - test_cmp_config -C repo false index.sparse - ) + git -C repo sparse-checkout init --cone --sparse-index && + test_cmp_config -C repo true index.sparse && + git -C repo ls-files --sparse >sparse && + git -C repo sparse-checkout disable && + git -C repo ls-files --sparse >full && + + cat >expect <<-\EOF && + @@ -1,4 +1,7 @@ + a + -deep/ + -folder1/ + -folder2/ + +deep/a + +deep/deeper1/a + +deep/deeper1/deepest/a + +deep/deeper2/a + +folder1/a + +folder2/a + EOF + + diff -u sparse full | tail -n +3 >actual && + test_cmp expect actual && + + git -C repo config --list >config && - ! grep index.sparse config ++ test_cmp_config -C repo false index.sparse ' test_expect_success 'cone mode: init and set' '