libgit2/libgit2 — pull request #2262 by arrbee (2014-04-10 23:38:56+00:00)
Title: Fix bug popping ignore files during wd iteration

There were a couple bugs in popping ignore files during iteration that could result in incorrect decisions being made and thus ignore files below the root either not being loaded correctly or not being popped at the right time.

One bug was an off-by-one in comparing the path of the .gitignore file with the path being exited during iteration. This would result in the ignore rules being applied even after the directory was exited.

The second bug was not correctly truncating the path being tracked during traversal if there were no ignores on the list (i.e. when you have no .gitignore at the root, but do have some in contained directories). This would result in some .gitignore files not being loaded (and creating a .gitignore at the root would generally work around this).