]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ds/sparse-checkout-requires-per-worktree-config'
authorJunio C Hamano <gitster@pobox.com>
Fri, 25 Feb 2022 23:47:33 +0000 (15:47 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 25 Feb 2022 23:47:33 +0000 (15:47 -0800)
"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

1  2 
builtin/sparse-checkout.c
builtin/worktree.c
config.c
config.h
sparse-index.c
t/t1091-sparse-checkout-builtin.sh
worktree.c

Simple merge
Simple merge
diff --cc config.c
Simple merge
diff --cc config.h
Simple merge
diff --cc sparse-index.c
Simple merge
index 3592d1244243e060fbdeb1916108f1dca0bf1d12,8a757b43e6cc4545ce7bfc9d99379a3f0e3857eb..502d42d183a098a9fbb07e5bb1dfca4915d05958
@@@ -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' '
diff --cc worktree.c
Simple merge