fix: show detached HEAD commits and drop the pseudo-branch - #89
Open
arumata wants to merge 2 commits into
Open
Conversation
git branch -a --format lists the detached state as a pseudo-branch whose %(refname) is "(HEAD detached at <hash>)" instead of a refs/... path. parseBranches surfaced it as a real local branch, which showed up in the branch list and produced an invalid "(HEAD detached ...)" entry in the reflog ref filter that failed with 'unknown revision' (issue the0807#65).
The log walk started only from --glob=refs/heads/remotes/tags, so a commit made in a detached HEAD was reachable from no ref and never appeared in the graph (issue the0807#63). Add HEAD itself as a start point in the unfiltered case.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two detached-HEAD fixes:\n\n- #63 — a commit made in a detached HEAD was reachable from no branch/tag, so the log walk (started only from
--glob=refs/heads/remotes/tags) omitted it from the graph.HEADis now an explicit start point.\n- #65 —git branch -a --formatlists the detached state as a pseudo-branch whose%(refname)is "(HEAD detached at <hash>)";parseBranchessurfaced it as a real branch, producing an invalid entry in the reflog ref filter that failed with 'unknown revision'.