From d549b6c9ff44d3ccb32b9bfe1816d3cfb1d7052a Mon Sep 17 00:00:00 2001 From: Meet Soni Date: Tue, 4 Feb 2025 09:35:58 +0530 Subject: refspec: relocate apply_refspecs and related funtions Move the functions `apply_refspecs()` and `apply_negative_refspecs()` from `remote.c` to `refspec.c`. These functions focus on applying refspecs, so centralizing them in `refspec.c` improves code organization by keeping refspec-related logic in one place. Signed-off-by: Meet Soni Signed-off-by: Junio C Hamano --- refspec.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'refspec.h') diff --git a/refspec.h b/refspec.h index be20ba53ab..2a28d043be 100644 --- a/refspec.h +++ b/refspec.h @@ -96,4 +96,16 @@ void refspec_find_all_matches(struct refspec *rs, struct refspec_item *query, struct string_list *results); +/* + * Remove all entries in the input list which match any negative refspec in + * the refspec list. + */ +struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs); + +/* + * Search for a refspec that matches the given name and return the + * corresponding destination (dst) if a match is found, NULL otherwise. + */ +char *apply_refspecs(struct refspec *rs, const char *name); + #endif /* REFSPEC_H */ -- cgit v1.3-5-g9baa