Re: SIGSEGV Error Occurs When Attempting to Unbundle Without Initializing Git Repository.
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Aug 12, 2024, 21:05 UTC
- Message-ID
- <Zrp5JnsVHbqs4TyN@tapette.crustytoothpaste.net>
- In-Reply-To
- <20240812114733.GA3732689@coredump.intra.peff.net>
On 2024-08-12 at 11:47:33, Jeff King wrote:
Show 13 quoted lines
> So one option is to just do that check earlier. But that leaves other > sub-commands of "git bundle": > > - "create" likewise requires a repo, and seems OK. That makes sense > since we're not reading anything. > > - "verify" requires a repo, which I wouldn't have expected, but I > guess it's because we probably unbundle under the hood to walk. > Anyway, it gets the ordering right here and checks the repo before > opening the bundle. > > - list-heads doesn't require a repo, and segfaults. So it really does > need some kind of detection or default to know which hash to use.
If the bundle is v2, it's SHA-1. If the bundle is v3, then it should have a an @object-format= header, which is sufficient to set the hash algorithm. The default for v3 is still SHA-1, but we have never emitted a v3 bundle without an object-format header (except for maybe a commit or two somewhere in the history).
-- brian m. carlson (they/them or he/him) Toronto, Ontario, CA