summaryrefslogtreecommitdiff
path: root/refspec.h
diff options
context:
space:
mode:
Diffstat (limited to 'refspec.h')
-rw-r--r--refspec.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/refspec.h b/refspec.h
index 584d9c9eb5..be20ba53ab 100644
--- a/refspec.h
+++ b/refspec.h
@@ -30,6 +30,8 @@ struct refspec_item {
char *raw;
};
+struct string_list;
+
#define REFSPEC_FETCH 1
#define REFSPEC_PUSH 0
@@ -80,4 +82,18 @@ int refname_matches_negative_refspec_item(const char *refname, struct refspec *r
int match_name_with_pattern(const char *key, const char *name,
const char *value, char **result);
+/*
+ * Queries a refspec for a match and updates the query item.
+ * Returns 0 on success, -1 if no match is found or negative refspec matches.
+ */
+int refspec_find_match(struct refspec *rs, struct refspec_item *query);
+
+/*
+ * Queries a refspec for all matches and appends results to the provided string
+ * list.
+ */
+void refspec_find_all_matches(struct refspec *rs,
+ struct refspec_item *query,
+ struct string_list *results);
+
#endif /* REFSPEC_H */