Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryorah <yoram.harmelin@gmail.com>2013-01-18 19:37:13 +0400
committeryorah <yoram.harmelin@gmail.com>2013-02-07 23:44:34 +0400
commit943700ecbbc2be4ef49c5c31d8e5c49353fd3d84 (patch)
tree4e49b623e5df6506acb995ed5b492ff18d658a18 /src/pathspec.h
parent41713ec15f66d263c2d7d40dd07f1f5a468e3e22 (diff)
Return the matched pathspec pattern in `git_pathspec_match_path`
Instead of returning directly the pattern as the return value, I used an out parameter, because the function also tests if the passed pathspecs vector is empty. If yes, it considers that the path "matches", but in that case there is no matched pattern per se.
Diffstat (limited to 'src/pathspec.h')
-rw-r--r--src/pathspec.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/pathspec.h b/src/pathspec.h
index dde63c7d0..c44561520 100644
--- a/src/pathspec.h
+++ b/src/pathspec.h
@@ -25,8 +25,16 @@ extern int git_pathspec_init(
/* free data from the pathspec vector */
extern void git_pathspec_free(git_vector *vspec);
-/* match a path against the vectorized pathspec */
+/*
+ * Match a path against the vectorized pathspec.
+ * The matched pathspec is passed back into the `matched_pathspec` parameter,
+ * unless it is passed as NULL by the caller.
+ */
extern bool git_pathspec_match_path(
- git_vector *vspec, const char *path, bool disable_fnmatch, bool casefold);
+ git_vector *vspec,
+ const char *path,
+ bool disable_fnmatch,
+ bool casefold,
+ const char **matched_pathspec);
#endif