Merge branch 'sb/clone-origin'
authorJunio C Hamano <redacted>
Tue, 27 Oct 2020 22:09:49 +0000 (15:09 -0700)
committerJunio C Hamano <redacted>
Tue, 27 Oct 2020 22:09:50 +0000 (15:09 -0700)
"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

1  2 
Documentation/config.txt
Documentation/git-clone.txt
builtin/clone.c
builtin/remote.c
refspec.c
refspec.h

Simple merge
Simple merge
diff --cc builtin/clone.c
index 391aa41075ee75fe20a7b9a4d79e73cd90e10375,a144e7f35bf5dc2908d94766be413f41db273f1d..a0841923cfe03663068d47ea2cc78a35b3dd3733
@@@ -1154,10 -1195,11 +1194,10 @@@ int cmd_clone(int argc, const char **ar
        if (option_sparse_checkout && git_sparse_checkout_init(dir))
                return 1;
  
-       remote = remote_get(option_origin);
+       remote = remote_get(remote_name);
  
 -      strbuf_addf(&default_refspec, "+%s*:%s*", src_ref_prefix,
 -                  branch_top.buf);
 -      refspec_append(&remote->fetch, default_refspec.buf);
 +      refspec_appendf(&remote->fetch, "+%s*:%s*", src_ref_prefix,
 +                      branch_top.buf);
  
        transport = transport_get(remote, remote->url[0]);
        transport_set_verbosity(transport, option_verbosity, option_progress);
Simple merge
diff --cc refspec.c
Simple merge
diff --cc refspec.h
Simple merge
git clone https://git.99rst.org/PROJECT