aboutsummaryrefslogtreecommitdiffstats
path: root/remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-02-12 10:08:54 -0800
committerJunio C Hamano <gitster@pobox.com>2025-02-12 10:08:54 -0800
commit0a99ffb4d6645142e68517c59db61b7e58a4f7cc (patch)
treebe7a8cad2f222763a145191470dff02ed7a16ad1 /remote.c
parent998c5f0c7554f511bafff587292f986a42fa2944 (diff)
parentf21ea69d945f958704f2fe143c2638ecae6e0d12 (diff)
downloadgit-0a99ffb4d6645142e68517c59db61b7e58a4f7cc.tar.gz
Merge branch 'ms/remote-valid-remote-name'
Code shuffling. * ms/remote-valid-remote-name: remote: relocate valid_remote_name
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/remote.c b/remote.c
index 4bef6a1398..5574b6a00f 100644
--- a/remote.c
+++ b/remote.c
@@ -2828,3 +2828,13 @@ char *relative_url(const char *remote_url, const char *url,
free(out);
return strbuf_detach(&sb, NULL);
}
+
+int valid_remote_name(const char *name)
+{
+ int result;
+ struct strbuf refspec = STRBUF_INIT;
+ strbuf_addf(&refspec, "refs/heads/test:refs/remotes/%s/test", name);
+ result = valid_fetch_refspec(refspec.buf);
+ strbuf_release(&refspec);
+ return result;
+}