Merge branch 'ms/remote-valid-remote-name'
Code shuffling. * ms/remote-valid-remote-name: remote: relocate valid_remote_namemaint
commit
0a99ffb4d6
10
refspec.c
10
refspec.c
|
@ -238,16 +238,6 @@ int valid_fetch_refspec(const char *fetch_refspec_str)
|
|||
return ret;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
void refspec_ref_prefixes(const struct refspec *rs,
|
||||
struct strvec *ref_prefixes)
|
||||
{
|
||||
|
|
|
@ -63,7 +63,6 @@ void refspec_appendn(struct refspec *rs, const char **refspecs, int nr);
|
|||
void refspec_clear(struct refspec *rs);
|
||||
|
||||
int valid_fetch_refspec(const char *refspec);
|
||||
int valid_remote_name(const char *name);
|
||||
|
||||
struct strvec;
|
||||
/*
|
||||
|
|
10
remote.c
10
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue