summaryrefslogtreecommitdiff
path: root/tests/diff/blob.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2016-08-12 09:06:15 +0200
committerPatrick Steinhardt <ps@pks.im>2016-08-12 14:47:54 +0200
commitfcb2c1c8956200f49263e6e0b3c681d100af4734 (patch)
treeb507e77cd3c7c258074c19f43970400c115a9e8b /tests/diff/blob.c
parent73dab7692e780e1df96093a54854795428eb66b4 (diff)
downloadlibgit2-fcb2c1c8956200f49263e6e0b3c681d100af4734.tar.gz
ignore: allow unignoring basenames in subdirectories
The .gitignore file allows for patterns which unignore previous ignore patterns. When unignoring a previous pattern, there are basically three cases how this is matched when no globbing is used: 1. when a previous file has been ignored, it can be unignored by using its exact name, e.g. foo/bar !foo/bar 2. when a file in a subdirectory has been ignored, it can be unignored by using its basename, e.g. foo/bar !bar 3. when all files with a basename are ignored, a specific file can be unignored again by specifying its path in a subdirectory, e.g. bar !foo/bar The first problem in libgit2 is that we did not correctly treat the second case. While we verified that the negative pattern matches the tail of the positive one, we did not verify if it only matches the basename of the positive pattern. So e.g. we would have also negated a pattern like foo/fruz_bar !bar Furthermore, we did not check for the third case, where a basename is being unignored in a certain subdirectory again. Both issues are fixed with this commit.
Diffstat (limited to 'tests/diff/blob.c')
0 files changed, 0 insertions, 0 deletions