From 008d896df5deaa967d4d86306b408333e8ef34c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sun, 8 Jun 2008 18:42:33 +0200 Subject: Teach new attribute 'export-ignore' to git-archive Paths marked with this attribute are not output to git-archive output. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- archive.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'archive.c') diff --git a/archive.c b/archive.c index 7a32c19d3..6502b76ef 100644 --- a/archive.c +++ b/archive.c @@ -82,3 +82,16 @@ void *sha1_file_to_archive(const char *path, const unsigned char *sha1, return buffer; } +int is_archive_path_ignored(const char *path) +{ + static struct git_attr *attr_export_ignore; + struct git_attr_check check[1]; + + if (!attr_export_ignore) + attr_export_ignore = git_attr("export-ignore", 13); + + check[0].attr = attr_export_ignore; + if (git_checkattr(path, ARRAY_SIZE(check), check)) + return 0; + return ATTR_TRUE(check[0].value); +} -- cgit v1.2.1