refspec: convert valid_fetch_refspec to use parse_refspec

Convert 'valid_fetch_refspec()' to use the new 'parse_refspec()'
function to only parse a single refspec and eliminate an allocation.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Brandon Williams
2018-05-16 15:57:52 -07:00
committed by Junio C Hamano
parent 6d4c057859
commit c8fa9efe3a
2 changed files with 10 additions and 10 deletions

View File

@ -14,7 +14,6 @@ struct refspec_item {
char *dst;
};
int valid_fetch_refspec(const char *refspec);
struct refspec_item *parse_fetch_refspec(int nr_refspec, const char **refspec);
struct refspec_item *parse_push_refspec(int nr_refspec, const char **refspec);
@ -45,4 +44,6 @@ void refspec_append(struct refspec *rs, const char *refspec);
void refspec_appendn(struct refspec *rs, const char **refspecs, int nr);
void refspec_clear(struct refspec *rs);
int valid_fetch_refspec(const char *refspec);
#endif /* REFSPEC_H */