diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/diff.c | 5 | ||||
-rw-r--r-- | src/status.c | 2 |
2 files changed, 5 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 */ diff --git a/src/status.c b/src/status.c index 633082c09..d78237689 100644 --- a/src/status.c +++ b/src/status.c @@ -99,6 +99,8 @@ int git_status_foreach_ext( diffopt.flags = diffopt.flags | GIT_DIFF_INCLUDE_UNMODIFIED; if ((opts->flags & GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS) != 0) diffopt.flags = diffopt.flags | GIT_DIFF_RECURSE_UNTRACKED_DIRS; + if ((opts->flags & GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH) != 0) + diffopt.flags = diffopt.flags | GIT_DIFF_DISABLE_PATHSPEC_MATCH; /* TODO: support EXCLUDE_SUBMODULES flag */ if (show != GIT_STATUS_SHOW_WORKDIR_ONLY && |