Skip to content

Commit

Permalink
Enable support for Xcode.app-bundled gitattributes
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy Huddleston Sequoia <[email protected]>
  • Loading branch information
jeremyhu committed Feb 27, 2023
1 parent 3d43557 commit ecb96eb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,14 @@ static const char *git_etc_gitattributes(void)
return system_wide;
}

static const char *git_xcode_gitattributes(void)
{
static const char *xcode_gitattributes;
if (!xcode_gitattributes)
xcode_gitattributes = system_path("share/git-core/gitattributes");
return xcode_gitattributes;
}

static const char *get_home_gitattributes(void)
{
if (!git_attributes_file)
Expand Down Expand Up @@ -874,7 +882,10 @@ static void bootstrap_attr_stack(struct index_state *istate,

/* system-wide frame */
if (git_attr_system()) {
e = read_attr_from_file(git_etc_gitattributes(), flags);
e = read_attr_from_file(git_xcode_gitattributes(), 1);
push_stack(stack, e, NULL, 0);

e = read_attr_from_file(git_etc_gitattributes(), 1);
push_stack(stack, e, NULL, 0);
}

Expand Down

0 comments on commit ecb96eb

Please sign in to comment.