diff options
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 */ |