summaryrefslogtreecommitdiff
path: root/tests/diff/diffiter.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2019-04-05 10:22:46 +0200
committerPatrick Steinhardt <ps@pks.im>2019-04-05 10:22:46 +0200
commit9d117e20119ffa1814253d822598d33721d04ece (patch)
tree0a71134bad7eafcfd24c677b38bbcc8e3198ac6d /tests/diff/diffiter.c
parentaeea1c463941806a0176859c06c0e2e9716efcb0 (diff)
downloadlibgit2-9d117e20119ffa1814253d822598d33721d04ece.tar.gz
ignore: treat paths with trailing "/" as directories
The function `git_ignore_path_is_ignored` is there to test the ignore status of paths that need not necessarily exist inside of a repository. This has the implication that for a given path, we cannot always decide whether it references a directory or a file, and we need to distinguish those cases because ignore rules may treat those differently. E.g. given the following gitignore file: * !/**/ we'd only want to unignore directories, while keeping files ignored. But still, calling `git_ignore_path_is_ignored("dir/")` will say that this directory is ignored because it treats "dir/" as a file path. As said, the `is_ignored` function cannot always decide whether the given path is a file or directory, and thus it may produce wrong results in some cases. While this is unfixable in the general case, we can do better when we are being passed a path name with a trailing path separator (e.g. "dir/") and always treat them as directories.
Diffstat (limited to 'tests/diff/diffiter.c')
0 files changed, 0 insertions, 0 deletions