diff options
author | John Cai <johncai86@gmail.com> | 2023-10-13 20:39:29 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-10-13 21:43:29 +0300 |
commit | 2386535511d1181afd4e892e2a866ffe5e1d7d21 (patch) | |
tree | de06be51d889c1f33076a04b96a3dc8f79febca4 /t/t0003-attributes.sh | |
parent | 43c8a30d150ecede9709c1f2527c8fba92c65f40 (diff) |
attr: read attributes from HEAD when bare repo
The motivation for 44451a2e5e (attr: teach "--attr-source=<tree>" global
option to "git" , 2023-05-06), was to make it possible to use
gitattributes with bare repositories.
To make it easier to read gitattributes in bare repositories however,
let's just make HEAD:.gitattributes the default. This is in line with
how mailmap works, 8c473cecfd (mailmap: default mailmap.blob in bare
repositories, 2012-12-13).
Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0003-attributes.sh')
-rwxr-xr-x | t/t0003-attributes.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh index 26e082f05b..5665cdc079 100755 --- a/t/t0003-attributes.sh +++ b/t/t0003-attributes.sh @@ -342,6 +342,17 @@ test_expect_success 'bare repository: check that .gitattribute is ignored' ' ) ' + +test_expect_success 'bare repo 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 && + git -C bare_with_gitattribute check-attr test -- f/path >actual && + test_cmp expect actual +' + test_expect_success 'bare repository: with --source' ' ( cd bare.git && |