summaryrefslogtreecommitdiff
path: root/src/path.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-08-08 14:51:36 -0700
committerRussell Belfer <rb@github.com>2014-08-08 14:51:36 -0700
commitf25bc0b2e6d764a496047e4f033767303b35b27e (patch)
treefe48c18e00224e9193cf2adc2b03c966e8d6da6e /src/path.h
parent35f186b6ca84a5e95de2e735834a87e19e7031d2 (diff)
downloadlibgit2-f25bc0b2e6d764a496047e4f033767303b35b27e.tar.gz
Fix rejection of parent dir of negated ignores
While scanning through a directory hierarchy, this prevents a positive ignore match on a parent directory from blocking the scan of a directory when a negative match rule exists for files inside the directory.
Diffstat (limited to 'src/path.h')
-rw-r--r--src/path.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/path.h b/src/path.h
index 2e86241e1..46d6efe93 100644
--- a/src/path.h
+++ b/src/path.h
@@ -128,6 +128,14 @@ GIT_INLINE(int) git_path_is_relative(const char *p)
return (p[0] == '.' && (p[1] == '/' || (p[1] == '.' && p[2] == '/')));
}
+/**
+ * Check if string is at end of path segment (i.e. looking at '/' or '\0')
+ */
+GIT_INLINE(int) git_path_at_end_of_segment(const char *p)
+{
+ return !*p || *p == '/';
+}
+
extern int git__percent_decode(git_buf *decoded_out, const char *input);
/**