diff options
author | Russell Belfer <rb@github.com> | 2013-08-07 20:17:20 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-08-09 22:41:41 +0400 |
commit | ba8b8c040744edb9bc832a67646e0126636753bb (patch) | |
tree | e82808b0e09eb1b344f76b6f1d76883967e487d4 /src/iterator.c | |
parent | d1be9e4ca18caa37c69afb988994a99cd137a3b8 (diff) |
Improve building ignore file lists
The routines to push and pop ignore files while traversing a
directory had some issues. In particular, setting up the initial
list would sometimes push an ignore file before it ought to be
applied if the starting path was a directory containing an ignore
file. Also, the pop function was not always matching the right
part of the path and would fail to pop ignores from the list in
some cases.
This adds some tests that exercise a particular problematic case
and then fixes the problems that I could find related to this.
At some point, I'd like to isolate this ignore rule management
code and rewrite it, but that's a larger project and right now,
I'll opt to just try to fix the broken behaviors.
Diffstat (limited to 'src/iterator.c')
-rw-r--r-- | src/iterator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/iterator.c b/src/iterator.c index 5917f63fd..bdc98d22b 100644 --- a/src/iterator.c +++ b/src/iterator.c @@ -1350,7 +1350,7 @@ int git_iterator_for_workdir_ext( wi->fi.update_entry_cb = workdir_iterator__update_entry; if ((error = iterator__update_ignore_case((git_iterator *)wi, flags)) < 0 || - (error = git_ignore__for_path(repo, "", &wi->ignores)) < 0) + (error = git_ignore__for_path(repo, ".gitignore", &wi->ignores)) < 0) { git_iterator_free((git_iterator *)wi); return error; |