summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2017-06-04 19:35:39 +0200
committerGitHub <noreply@github.com>2017-06-04 19:35:39 +0200
commit82e929a88bc79dc5ebd9a8484a40319ac6768c9b (patch)
tree442c2fd9ef95053443c01926a01167e4cd1782ad /src
parent04de614b1f421d99240d049763546f2d06421248 (diff)
parentc3b8e8b3583b3767f8a0e124893083a15226afec (diff)
downloadlibgit2-82e929a88bc79dc5ebd9a8484a40319ac6768c9b.tar.gz
Merge pull request #4239 from roblg/toplevel-dir-ignore-fix
Fix issue with directory glob ignore in subdirectories
Diffstat (limited to 'src')
-rw-r--r--src/attr_file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/attr_file.c b/src/attr_file.c
index 0bb761d04..e30ea5e0c 100644
--- a/src/attr_file.c
+++ b/src/attr_file.c
@@ -395,9 +395,13 @@ bool git_attr_fnmatch__match(
if ((match->flags & GIT_ATTR_FNMATCH_DIRECTORY) && !path->is_dir) {
bool samename;
- /* for attribute checks or root ignore checks, fail match */
+ /*
+ * for attribute checks or checks at the root of this match's
+ * containing_dir (or root of the repository if no containing_dir),
+ * do not match.
+ */
if (!(match->flags & GIT_ATTR_FNMATCH_IGNORE) ||
- path->basename == path->path)
+ path->basename == relpath)
return false;
flags |= FNM_LEADING_DIR;