summaryrefslogtreecommitdiff
path: root/src/attr_file.h
diff options
context:
space:
mode:
authorRussell Belfer <arrbee@arrbee.com>2012-01-16 16:58:27 -0800
committerRussell Belfer <arrbee@arrbee.com>2012-01-16 16:58:27 -0800
commita51cd8e6f6724079a552b75e014f792f3f68e158 (patch)
treefcf526f2a7575e215d95589d1a8e07277981fd18 /src/attr_file.h
parent6e03b12f5715cb3f5cb5c8be6512e041cdf44a05 (diff)
downloadlibgit2-a51cd8e6f6724079a552b75e014f792f3f68e158.tar.gz
Fix handling of relative paths for attrs
Per issue #533, the handling of relative paths in attribute and ignore files was not right. Fixed this by pre-joining the relative path of the attribute/ignore file onto the match string when a full path match is required. Unfortunately, fixing this required a bit more code than I would have liked because I had to juggle things around so that the fnmatch parser would have sufficient information to prepend the relative path when it was needed.
Diffstat (limited to 'src/attr_file.h')
-rw-r--r--src/attr_file.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/attr_file.h b/src/attr_file.h
index 7190c4c7b..304c7a854 100644
--- a/src/attr_file.h
+++ b/src/attr_file.h
@@ -62,13 +62,16 @@ typedef struct {
* git_attr_file API
*/
+extern int git_attr_file__new(git_attr_file **attrs_ptr);
+extern void git_attr_file__free(git_attr_file *file);
+
extern int git_attr_file__from_buffer(
- git_repository *repo, const char *buf, git_attr_file **out);
+ git_repository *repo, const char *buf, git_attr_file *file);
extern int git_attr_file__from_file(
- git_repository *repo, const char *path, git_attr_file **out);
+ git_repository *repo, const char *path, git_attr_file *file);
-extern int git_attr_file__new(git_attr_file **attrs_ptr);
-extern void git_attr_file__free(git_attr_file *file);
+extern int git_attr_file__set_path(
+ git_repository *repo, const char *path, git_attr_file *file);
extern int git_attr_file__lookup_one(
git_attr_file *file,
@@ -90,6 +93,7 @@ extern unsigned long git_attr_file__name_hash(const char *name);
extern int git_attr_fnmatch__parse(
git_attr_fnmatch *spec,
+ const char *source,
const char **base);
extern int git_attr_fnmatch__match(