diff options
author | yorah <yoram.harmelin@gmail.com> | 2012-07-23 18:16:09 +0200 |
---|---|---|
committer | yorah <yoram.harmelin@gmail.com> | 2012-07-24 14:03:09 +0200 |
commit | a1773f9d89887d299248d15b43953d3fa494a025 (patch) | |
tree | 4b204fca95ff0e11766eb3d570c919874d9908db /src/diff.c | |
parent | ffbc689c8768c66cddf9ef3ab6c88c41ecf4c1ab (diff) | |
download | libgit2-a1773f9d89887d299248d15b43953d3fa494a025.tar.gz |
Add flag to turn off pathspec testing for diff and status
Diffstat (limited to 'src/diff.c')
-rw-r--r-- | src/diff.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/diff.c b/src/diff.c index f08688e38..2b1529d63 100644 --- a/src/diff.c +++ b/src/diff.c @@ -61,9 +61,10 @@ static bool diff_path_matches_pathspec(git_diff_list *diff, const char *path) return true; git_vector_foreach(&diff->pathspec, i, match) { - int result = strcmp(match->pattern, path); + int result = strcmp(match->pattern, path) ? FNM_NOMATCH : 0; - if (result != 0) + if (((diff->opts.flags & GIT_DIFF_DISABLE_PATHSPEC_MATCH) == 0) && + result == FNM_NOMATCH) result = p_fnmatch(match->pattern, path, 0); /* if we didn't match, look for exact dirname prefix match */ |