diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-05-31 15:28:19 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-05-31 15:28:19 -0700 |
| commit | 1258fc2b08543bac83aea5ad856b4a64348c3c79 (patch) | |
| tree | 2fcb6809b873bcb9020158e41ad15710e72df8e5 /t | |
| parent | 1b2e9068f82beea34e11f4183f13e5c0b7917f01 (diff) | |
| parent | 51441e6460b505c07b4a8a6deeaa7de4bf6e8e33 (diff) | |
| download | git-1258fc2b08543bac83aea5ad856b4a64348c3c79.tar.xz | |
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
Diffstat (limited to 't')
| -rwxr-xr-x | t/t0003-attributes.sh | 10 | ||||
| -rwxr-xr-x | t/t5001-archive-attr.sh | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh index 774b52c298..d755cc3c29 100755 --- a/t/t0003-attributes.sh +++ b/t/t0003-attributes.sh @@ -398,13 +398,19 @@ test_expect_success 'bad attr source defaults to reading .gitattributes file' ' ) ' -test_expect_success 'bare repo defaults to reading .gitattributes from HEAD' ' +test_expect_success 'bare repo no longer defaults to reading .gitattributes from HEAD' ' test_when_finished rm -rf test bare_with_gitattribute && git init test && test_commit -C test gitattributes .gitattributes "f/path test=val" && git clone --bare test bare_with_gitattribute && - echo "f/path: test: val" >expect && + + echo "f/path: test: unspecified" >expect && git -C bare_with_gitattribute check-attr test -- f/path >actual && + test_cmp expect actual && + + echo "f/path: test: val" >expect && + git -C bare_with_gitattribute -c attr.tree=HEAD \ + check-attr test -- f/path >actual && test_cmp expect actual ' diff --git a/t/t5001-archive-attr.sh b/t/t5001-archive-attr.sh index eaf959d8f6..7310774af5 100755 --- a/t/t5001-archive-attr.sh +++ b/t/t5001-archive-attr.sh @@ -133,7 +133,8 @@ test_expect_success 'git archive vs. bare' ' ' test_expect_success 'git archive with worktree attributes, bare' ' - (cd bare && git archive --worktree-attributes HEAD) >bare-worktree.tar && + (cd bare && + git -c attr.tree=HEAD archive --worktree-attributes HEAD) >bare-worktree.tar && (mkdir bare-worktree && cd bare-worktree && "$TAR" xf -) <bare-worktree.tar ' |
