mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Merge branch 'sb/clone-origin'
"git clone" learned clone.defaultremotename configuration variable to customize what nickname to use to call the remote the repository was cloned from. * sb/clone-origin: clone: allow configurable default for `-o`/`--origin` clone: read new remote name from remote_name instead of option_origin clone: validate --origin option before use refs: consolidate remote name validation remote: add tests for add and rename with invalid names clone: use more conventional config/option layering clone: add tests for --template and some disallowed option pairs
This commit is contained in:
10
refspec.c
10
refspec.c
@@ -245,6 +245,16 @@ 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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user