Re: update_linked_gitdir writes relative path to .git/worktrees/<id>/gitdir
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 7, 2016, 23:56 UTC
- Message-ID
- <xmqqlh6w9isp.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <1454789548.23898.223.camel@mattmccutchen.net>
Matt McCutchen <matt@mattmccutchen.net> writes:
> I noticed that when update_linked_gitdir chooses to update > .git/worktrees/<id>/gitdir, the path it writes is relative, at least > under some circumstances. This contradicts the gitrepository-layout > man page, which says:
Duy, is it safe to say that the fix has already been cooking in 'next' as nd/do-not-move-worktree-manually topic, we are about to solve this by merging down to 'master', _and_ it is very much appreciated when reporting bugs people check if a presumed fix is already cooking in 'next', try it to verify if it really fixes their problem, and send in a "OK fix is good" / "No that does not fix my case"?
Show 33 quoted lines
> > worktrees/<id>/gitdir:: > A text file containing the absolute path back to the .git file > that points to here. > > IIUC, this behavior defeats one of the three safeguards that is > supposed to prevent "git worktree prune" from pruning information for > worktrees that still exist. > > A simple script to reproduce: > > #!/bin/bash > set -e -x > rm -rf repo worktree2 > git init repo > cd repo > touch foo > git add foo > git commit -m 'dummy commit' > git worktree add ../worktree2 -b branch2 > cat .git/worktrees/worktree2/gitdir > touch -d '2 days ago' .git/worktrees/worktree2/gitdir > (cd ../worktree2 && git status) > cat .git/worktrees/worktree2/gitdir > > Trying this on master as of earlier today (ff4ea60), I get: > > [...] > /PATH/REDACTED/worktree2/.git > [...] > .git > > Matt