Re: [PATCH] sha1-name.c: for ":/", find detached HEAD commits
- From
William Chargin <wchargin@gmail.com>
- Date
- Jul 11, 2018, 17:49 UTC
- Message-ID
- <CAFW+GMD62V=o4hoEYKVteBZHzqBtquzLzTv2WXiSPZf3ZhOpeg@mail.gmail.com>
- In-Reply-To
- <CACsJy8AMwKHUyUe-4-MKLn1D3x-+iiFW-Wdjj+HeX_JZ=MkO+w@mail.gmail.com>
> > Does for_each_ref() iterate over per-worktree refs (like "bisect", > > perhaps)? > > No.
To be clear: it iterates only over the per-worktree refs for the current worktree. So, if you mark an unreachable commit as "bad" with bisect, then that commit is reachable (and found by ":/") in the enclosing worktree only.
With this patch, ":/" now behaves the same way with HEADs, which makes sense to me. Agreed with the above discussion.
I can add a test for this.