Merge branch 'es/clone-shared-worktree'

"git clone --shared" to borrow from a (secondary) worktree did not
work, even though "git clone --local" did.  Both are now accepted.

* es/clone-shared-worktree:
  clone: support 'clone --shared' from a worktree
This commit is contained in:
Junio C Hamano
2017-12-27 11:16:28 -08:00
2 changed files with 8 additions and 1 deletions

View File

@ -452,7 +452,8 @@ static void clone_local(const char *src_repo, const char *dest_repo)
{
if (option_shared) {
struct strbuf alt = STRBUF_INIT;
strbuf_addf(&alt, "%s/objects", src_repo);
get_common_dir(&alt, src_repo);
strbuf_addstr(&alt, "/objects");
add_to_alternates_file(alt.buf);
strbuf_release(&alt);
} else {