diff mbox series

[(Apple,Git),13/13] Enable support for Xcode.app-bundled gitattributes

Message ID 20190129193818.8645-14-jeremyhu@apple.com (mailing list archive)
State New, archived
Headers show
Series Differences between git-2.20.1 and Apple Git-116 | expand

Commit Message

Jeremy Sequoia Jan. 29, 2019, 7:38 p.m. UTC
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
---
 attr.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/attr.c b/attr.c
index eaece6658d..1b87905d4a 100644
--- a/attr.c
+++ b/attr.c
@@ -823,6 +823,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)
@@ -864,6 +872,9 @@  static void bootstrap_attr_stack(const struct index_state *istate,
 
 	/* system-wide frame */
 	if (git_attr_system()) {
+		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);
 	}