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:
Diffstat (limited to 'include/git2/refspec.h')
-rw-r--r--include/git2/refspec.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/include/git2/refspec.h b/include/git2/refspec.h
index c0a8eabfe..ec7830b7c 100644
--- a/include/git2/refspec.h
+++ b/include/git2/refspec.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2012 the libgit2 contributors
+ * Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
@@ -36,6 +36,14 @@ GIT_EXTERN(const char *) git_refspec_src(const git_refspec *refspec);
GIT_EXTERN(const char *) git_refspec_dst(const git_refspec *refspec);
/**
+ * Get the force update setting
+ *
+ * @param refspec the refspec
+ * @return 1 if force update has been set, 0 otherwise
+ */
+GIT_EXTERN(int) git_refspec_force(const git_refspec *refspec);
+
+/**
* Check if a refspec's source descriptor matches a reference
*
* @param refspec the refspec
@@ -45,16 +53,36 @@ GIT_EXTERN(const char *) git_refspec_dst(const git_refspec *refspec);
GIT_EXTERN(int) git_refspec_src_matches(const git_refspec *refspec, const char *refname);
/**
+ * Check if a refspec's destination descriptor matches a reference
+ *
+ * @param refspec the refspec
+ * @param refname the name of the reference to check
+ * @return 1 if the refspec matches, 0 otherwise
+ */
+GIT_EXTERN(int) git_refspec_dst_matches(const git_refspec *refspec, const char *refname);
+
+/**
* Transform a reference to its target following the refspec's rules
*
* @param out where to store the target name
- * @param outlen the size ouf the `out` buffer
+ * @param outlen the size of the `out` buffer
* @param spec the refspec
* @param name the name of the reference to transform
* @return 0, GIT_EBUFS or another error
*/
GIT_EXTERN(int) git_refspec_transform(char *out, size_t outlen, const git_refspec *spec, const char *name);
+/**
+ * Transform a target reference to its source reference following the refspec's rules
+ *
+ * @param out where to store the source reference name
+ * @param outlen the size of the `out` buffer
+ * @param spec the refspec
+ * @param name the name of the reference to transform
+ * @return 0, GIT_EBUFS or another error
+ */
+GIT_EXTERN(int) git_refspec_rtransform(char *out, size_t outlen, const git_refspec *spec, const char *name);
+
GIT_END_DECL
#endif