attr: add attr.tree for setting the treeish to read attributes from

44451a2 (attr: teach "--attr-source=<tree>" global option to "git",
2023-05-06) provided the ability to pass in a treeish as the attr
source. In the context of serving Git repositories as bare repos like we
do at GitLab however, it would be easier to point --attr-source to HEAD
for all commands by setting it once.

Add a new config attr.tree that allows this.

Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
John Cai
2023-10-13 17:39:30 +00:00
committed by Junio C Hamano
parent 2386535511
commit 9f9c40cf34
6 changed files with 95 additions and 0 deletions

2
attr.h
View File

@ -236,4 +236,6 @@ const char *git_attr_global_file(void);
/* Return whether the system gitattributes file is enabled and should be used. */
int git_attr_system_is_enabled(void);
extern const char *git_attr_tree;
#endif /* ATTR_H */