On 2024-08-12 at 11:47:33, Jeff King wrote: > 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
Attachment:
signature.asc
Description: PGP signature