#ifndef REFSPEC_H
#define REFSPEC_H
+struct string_list;
+struct strvec;
+
#define TAG_REFSPEC "refs/tags/*:refs/tags/*"
/**
char *raw;
};
-struct string_list;
-
-#define REFSPEC_INIT_FETCH { .fetch = 1 }
-#define REFSPEC_INIT_PUSH { .fetch = 0 }
+int refspec_item_init_fetch(struct refspec_item *item, const char *refspec);
+int refspec_item_init_push(struct refspec_item *item, const char *refspec);
+void refspec_item_clear(struct refspec_item *item);
/**
* An array of strings can be parsed into a struct refspec using
unsigned fetch : 1;
};
-int refspec_item_init_fetch(struct refspec_item *item, const char *refspec);
-int refspec_item_init_push(struct refspec_item *item, const char *refspec);
-void refspec_item_clear(struct refspec_item *item);
+#define REFSPEC_INIT_FETCH { .fetch = 1 }
+#define REFSPEC_INIT_PUSH { .fetch = 0 }
+
void refspec_init_fetch(struct refspec *rs);
void refspec_init_push(struct refspec *rs);
+void refspec_clear(struct refspec *rs);
+
void refspec_append(struct refspec *rs, const char *refspec);
__attribute__((format (printf,2,3)))
void refspec_appendf(struct refspec *rs, const char *fmt, ...);
void refspec_appendn(struct refspec *rs, const char **refspecs, int nr);
-void refspec_clear(struct refspec *rs);
int valid_fetch_refspec(const char *refspec);
-struct strvec;
/*
* Determine what <prefix> values to pass to the peer in ref-prefix lines
* (see linkgit:gitprotocol-v2[5]).
* Returns 1 if refname matches pattern, 0 otherwise.
*/
int match_refname_with_pattern(const char *pattern, const char *refname,
- const char *replacement, char **result);
+ const char *replacement, char **result);
/*
* Queries a refspec for a match and updates the query item.
* list.
*/
void refspec_find_all_matches(struct refspec *rs,
- struct refspec_item *query,
- struct string_list *results);
+ struct refspec_item *query,
+ struct string_list *results);
/*
* Remove all entries in the input list which match any negative refspec in