summaryrefslogtreecommitdiff
path: root/include/git2/refspec.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2011-06-22 16:52:30 +0200
committerCarlos Martín Nieto <carlos@cmartin.tk>2011-06-26 18:18:11 +0200
commit63f91e1ce856da0a6cfd7ec70f24b087a30ef358 (patch)
tree0f6cf49a95e246d46b15ad32df5506bca2f393f0 /include/git2/refspec.h
parentf8f3feb0d3e98542b6f7a4ac214a65e7f9950d5b (diff)
downloadlibgit2-63f91e1ce856da0a6cfd7ec70f24b087a30ef358.tar.gz
Add git.git's fnmatch, which is really GNU's and the git__fnmatch wrapper
If the strings match, git__fnmatch returns GIT_SUCCESS and GIT_ENOMATCH on failure to match. MSVC fixes: Added a test for _MSC_VER and (in that case) defined HAVE_STRING_H to 1 so it doesn't try to include <strings.h> which doesn't exist in the MSVC world. Moved the function declarations to use the modern inline ones so MSVC doesn't have a fit. Added casts everywhere so MSVC doesn't crap its pants. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Diffstat (limited to 'include/git2/refspec.h')
-rw-r--r--include/git2/refspec.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/git2/refspec.h b/include/git2/refspec.h
index d45364f71..8523d5ab6 100644
--- a/include/git2/refspec.h
+++ b/include/git2/refspec.h
@@ -19,4 +19,14 @@ const char *git_refspec_src(const git_refspec *refspec);
*/
const char *git_refspec_dst(const git_refspec *refspec);
+/**
+ * Match a refspec's source descriptor with a reference name
+ *
+ * @param refspec the refspec
+ * @param refname the name of the reference to check
+ * @return GIT_SUCCESS on successful match; GIT_ENOMACH on match
+ * failure or an error code on other failure
+ */
+int git_refspec_src_match(const git_refspec *refspec, const char *refname);
+
#endif