On Fri, Oct 30, 2020 at 11:46:41AM +0000, Sohom Datta via GitGitGadget wrote: > From: Sohom Datta <sohom.datta@xxxxxxxxxxxxxxxxxxx> > > Git allows users to create tags pointing to object hashes > that may or may not be commits. When a tag that doesn't > point to a commit is used with the -b (--branch) parameter > of git clone, git segfaults as it assumes that the tag will > always reference a commit. > > Add a check to make sure that lookup_commit_reference returns a commit > before detaching HEAD. This seemed eerily familiar, so I dug up these threads: - https://lore.kernel.org/git/20191029092735.GA84120@xxxxxxxxxxxxx/ - https://lore.kernel.org/git/20191101002432.GA49846@xxxxxxxxxxxxx/ The interesting things are: - there are some other cases where we might see a non-commit, which are also worth covering - it would be friendlier to the user to put in a fallback value for HEAD. We already transferred the whole history, so deleting it is a bit less friendly than leaving it in a state the user can recover from locally I think the patches there were moving in a good direction, but it looks like they just got stalled. -Peff