You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
object_db: add support for multiple hash algorithms
Currently, our object DB has support for one major type of option:
alternates. However, we also need to deal with the Git SHA-256
transition as well so we can support objects in repositories using
SHA-256.
Since we have multiple types of options, let's switch to an
options-style initializer as well. This is a breaking API change, so
we'll need to bump the major version and update go.mod and our package
declarations accordingly.
Create a Hasher method which tells us which hash algorithm is in use in
this repository. We can then either hash our objects or query our
hasher for properties such as the size.
Because we'll also want to look up a hash algorithm before we have an
object DB opened, let's make that Hasher method a wrapper around an
internal function that we can use in this case to instantiate a hash
algorithm based on its ID and use it in our object DB method.
Note that this doesn't intrinsically add support for parsing these
objects, which will come in a future commit, but it does lay the
groundwork for that.
0 commit comments