summaryrefslogtreecommitdiff
path: root/src/ignore.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-04-18 10:32:35 -0700
committerRussell Belfer <rb@github.com>2014-04-18 10:32:35 -0700
commit6a0956e504328f6584af971e840c202ecb21b5b6 (patch)
tree234b3fc25eecccc41a6cafe7c7322eb476b67569 /src/ignore.h
parent3c69bebc1c18444e9358c33f56c7cfefea4d1a8f (diff)
downloadlibgit2-6a0956e504328f6584af971e840c202ecb21b5b6.tar.gz
Pop ignore only if whole relative path matches
When traversing the directory structure, the iterator pushes and pops ignore files using a vector. Some directories don't have ignore files, so it uses a path comparison to decide when it is right to actually pop the last ignore file. This was only comparing directory suffixes, though, so a subdirectory with the same name as a parent could result in the parent's .gitignore being popped off the list ignores too early. This changes the logic to compare the entire relative path of the ignore file.
Diffstat (limited to 'src/ignore.h')
-rw-r--r--src/ignore.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ignore.h b/src/ignore.h
index 46172c72f..ff9369000 100644
--- a/src/ignore.h
+++ b/src/ignore.h
@@ -28,6 +28,7 @@ typedef struct {
git_attr_file *ign_internal;
git_vector ign_path;
git_vector ign_global;
+ size_t dir_root; /* offset in dir to repo root */
int ignore_case;
int depth;
} git_ignores;