Re: Shared clone from worktree directory
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Dec 11, 2017, 19:55 UTC
- Message-ID
- <CAPig+cSxOcSkANUx2+nuVdN9VHiuy_X0Xk7L64G6=07fLf9q+A@mail.gmail.com>
- In-Reply-To
- <CAJ+F1CJB+fOJmYpDQtjn1kLa-wk=oUeQGjO7q=N2igYhVG0tiQ@mail.gmail.com>
On Mon, Dec 11, 2017 at 12:02 PM, Marc-André Lureau <marcandre.lureau@gmail.com> wrote:
Show 19 quoted lines
> For better, or worse, I encountered a script doing a git clone > --shared from the working directory. However, if clone --shared is run > from a worktree, it fails with cryptic errors. > > elmarco@boraha:/tmp/test/wt (wt)$ git worktree list > /tmp/test 4ae16a0 [master] > /tmp/test/wt 4ae16a0 [wt] > elmarco@boraha:/tmp/test/wt (wt)$ git clone --shared . clone-dir > Cloning into 'clone-dir'... > done. > error: object directory /tmp/test/.git/worktrees/wt/objects does not > exist; check .git/objects/info/alternates. > fatal: update_ref failed for ref 'HEAD': cannot update ref > 'refs/heads/wt': trying to write ref 'refs/heads/wt' with nonexistent > object 4ae16a066ee088d40dbefeaaae7b5578d68b4b51 > fatal: The remote end hung up unexpectedly > > Is this a bug? If not, a nicer error message would be welcome, as well > as man page note.
Looks like a simple oversight in the 'worktree' implementation. I worked up a patch to fix it, which I'll try to send out later today.