Git fork

Merge branch 'jc/no-default-attr-tree-in-bare' into maint-2.45

Git 2.43 started using the tree of HEAD as the source of attributes
in a bare repository, which has severe performance implications.
For now, revert the change, without ripping out a more explicit
support for the attr.tree configuration variable.

* jc/no-default-attr-tree-in-bare:
stop using HEAD for attributes in bare repository by default

+10 -10
-7
attr.c
··· 1223 1223 ignore_bad_attr_tree = 1; 1224 1224 } 1225 1225 1226 - if (!default_attr_source_tree_object_name && 1227 - startup_info->have_repository && 1228 - is_bare_repository()) { 1229 - default_attr_source_tree_object_name = "HEAD"; 1230 - ignore_bad_attr_tree = 1; 1231 - } 1232 - 1233 1226 if (!default_attr_source_tree_object_name || !is_null_oid(attr_source)) 1234 1227 return; 1235 1228
+8 -2
t/t0003-attributes.sh
··· 398 398 ) 399 399 ' 400 400 401 - test_expect_success 'bare repo defaults to reading .gitattributes from HEAD' ' 401 + test_expect_success 'bare repo no longer defaults to reading .gitattributes from HEAD' ' 402 402 test_when_finished rm -rf test bare_with_gitattribute && 403 403 git init test && 404 404 test_commit -C test gitattributes .gitattributes "f/path test=val" && 405 405 git clone --bare test bare_with_gitattribute && 406 - echo "f/path: test: val" >expect && 406 + 407 + echo "f/path: test: unspecified" >expect && 407 408 git -C bare_with_gitattribute check-attr test -- f/path >actual && 409 + test_cmp expect actual && 410 + 411 + echo "f/path: test: val" >expect && 412 + git -C bare_with_gitattribute -c attr.tree=HEAD \ 413 + check-attr test -- f/path >actual && 408 414 test_cmp expect actual 409 415 ' 410 416
+2 -1
t/t5001-archive-attr.sh
··· 133 133 ' 134 134 135 135 test_expect_success 'git archive with worktree attributes, bare' ' 136 - (cd bare && git archive --worktree-attributes HEAD) >bare-worktree.tar && 136 + (cd bare && 137 + git -c attr.tree=HEAD archive --worktree-attributes HEAD) >bare-worktree.tar && 137 138 (mkdir bare-worktree && cd bare-worktree && "$TAR" xf -) <bare-worktree.tar 138 139 ' 139 140