On Thu, Mar 7, 2019 at 4:38 PM Phillip Wood <phillip.wood123@xxxxxxxxx> wrote: > > On 06/03/2019 15:57, Phillip Wood wrote: > > When it is run in a worktree 'git for-each-ref' only seems to show refs > > under refs/rewritten if that directory also exists under $GIT_COMMON_DIR > > even though they are local to the worktree. > > > > Initially I thought this was due to $GIT_COMMON_DIR pointing to a bare > > repo, but that is not the case. However while writing a test case which > > cloned to a bare repo I noticed it was listing a ref for the HEAD of a > > worktree in the repo I had cloned from, not the clone itself. > > Ignore that last paragraph, it's just showing the branch that got > created when the worktree was created. The last part of the script is > redundant, I've updated it below Thanks for the test script. I could reproduce it and I think I see the problem (update-ref creates per-worktree refs even though refs/rewritten should be per-repo). Working on it... -- Duy