aboutsummaryrefslogtreecommitdiffstats
path: root/remote.c
diff options
context:
space:
mode:
authorMeet Soni <meetsoni3017@gmail.com>2025-02-04 09:35:58 +0530
committerJunio C Hamano <gitster@pobox.com>2025-02-04 09:51:42 -0800
commitd549b6c9ff44d3ccb32b9bfe1816d3cfb1d7052a (patch)
tree283108093dffa111ed78d80f3bc01ee1bb209233 /remote.c
parent7b24a170d2c36c83c3669d194af46a09ccdeec43 (diff)
downloadgit-d549b6c9ff44d3ccb32b9bfe1816d3cfb1d7052a.tar.gz
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 <meetsoni3017@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/remote.c b/remote.c
index 4c5940482f..7f27c59a5b 100644
--- a/remote.c
+++ b/remote.c
@@ -907,37 +907,6 @@ void ref_push_report_free(struct ref_push_report *report)
}
}
-struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs)
-{
- struct ref **tail;
-
- for (tail = &ref_map; *tail; ) {
- struct ref *ref = *tail;
-
- if (refname_matches_negative_refspec_item(ref->name, rs)) {
- *tail = ref->next;
- free(ref->peer_ref);
- free(ref);
- } else
- tail = &ref->next;
- }
-
- return ref_map;
-}
-
-char *apply_refspecs(struct refspec *rs, const char *name)
-{
- struct refspec_item query;
-
- memset(&query, 0, sizeof(struct refspec_item));
- query.src = (char *)name;
-
- if (refspec_find_match(rs, &query))
- return NULL;
-
- return query.dst;
-}
-
int remote_find_tracking(struct remote *remote, struct refspec_item *refspec)
{
return refspec_find_match(&remote->fetch, refspec);