Cannot clone a linked working directory.

2015-06-24 Thread Bjørnar Snoksrud
Summary:
When creating a linked working directory with `git checkout --to`, you
cannot clone from the local path. This works when cloning the main
repository directory.

I couldn't find anything the the documentation for `git checkout` that
indicates that this shouldn't work.

Repro:
Creating a repo `foo`, checkout --to'ing it to ../bar, then try to
clone both resulting repositories -

$ git --version
git version 2.4.4.600.g6397abd
$ mkdir foo
$ cd foo
$ git init
Initialized empty Git repository in /bar/foo/.git/
$ git commit -m init --allow-empty
[master (root-commit) c6da399] init
$ git branch bar
$ git checkout bar --to ../bar
Enter ../bar (identifier bar)
Switched to branch 'bar'
$ cd ../bar
$ cd bar
$ git status -sb
## bar
$ cd ..
$ git clone bar baz
Cloning into 'baz'...
fatal: '/path/bar' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
$ git clone foo baz
Cloning into 'baz'...
done.


-- 
bjor...@snoksrud.no
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Cannot clone a linked working directory.

2015-06-24 Thread Duy Nguyen
On Wed, Jun 24, 2015 at 5:38 PM, Bjørnar Snoksrud snoks...@gmail.com wrote:
 Summary:
 When creating a linked working directory with `git checkout --to`, you
 cannot clone from the local path. This works when cloning the main
 repository directory.

 I couldn't find anything the the documentation for `git checkout` that
 indicates that this shouldn't work.

I didn't think of this use case. If something works on the main
worktree then it should also work on linked checkouts. I think I see
the problem and will try to fix it in probably a few days (the git
add -N problem takes higher priority).
-- 
Duy
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html