Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/attr.c
diff options
context:
space:
mode:
authorbrian m. carlson <bk2204@github.com>2023-06-27 19:19:00 +0300
committerJunio C Hamano <gitster@pobox.com>2023-06-27 21:31:06 +0300
commit15780bb4f0cb07624ca6bac3c430ef07e9501663 (patch)
treefb312f30a87d3e00198c8591e00329747e0a4abd /attr.c
parentcdd489eaf9cd3c46c30b485601e2bcb989586274 (diff)
attr: expose and rename accessor functions
Right now, the functions which determine the current system and global gitattributes files are not exposed. We'd like to use them in a future commit, but they're not ideally named. Rename them to something more suitable as a public interface, expose them, and document them. Signed-off-by: brian m. carlson <bk2204@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'attr.c')
-rw-r--r--attr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/attr.c b/attr.c
index d45d34058d..66203ce322 100644
--- a/attr.c
+++ b/attr.c
@@ -870,7 +870,7 @@ static struct attr_stack *read_attr(struct index_state *istate,
return res;
}
-static const char *git_etc_gitattributes(void)
+const char *git_attr_system_file(void)
{
static const char *system_wide;
if (!system_wide)
@@ -878,7 +878,7 @@ static const char *git_etc_gitattributes(void)
return system_wide;
}
-static const char *get_home_gitattributes(void)
+const char *git_attr_global_file(void)
{
if (!git_attributes_file)
git_attributes_file = xdg_config_home("attributes");
@@ -886,7 +886,7 @@ static const char *get_home_gitattributes(void)
return git_attributes_file;
}
-static int git_attr_system(void)
+int git_attr_system_is_enabled(void)
{
return !git_env_bool("GIT_ATTR_NOSYSTEM", 0);
}
@@ -920,14 +920,14 @@ static void bootstrap_attr_stack(struct index_state *istate,
push_stack(stack, e, NULL, 0);
/* system-wide frame */
- if (git_attr_system()) {
- e = read_attr_from_file(git_etc_gitattributes(), flags);
+ if (git_attr_system_is_enabled()) {
+ e = read_attr_from_file(git_attr_system_file(), flags);
push_stack(stack, e, NULL, 0);
}
/* home directory */
- if (get_home_gitattributes()) {
- e = read_attr_from_file(get_home_gitattributes(), flags);
+ if (git_attr_global_file()) {
+ e = read_attr_from_file(git_attr_global_file(), flags);
push_stack(stack, e, NULL, 0);
}