Commit Graph

4 Commits

Author SHA1 Message Date
Chris Darroch
dd8e306e31 all: update go.mod module path with explicit v2
When our go.mod file was introduced in commit
114e85c2002091eb415040923d872f8e4a4bc636 in PR #3208, the module
path chosen did not include a trailing /v2 component.  However,
the Go modules specification now advises that module paths must
have a "major version suffix" which matches the release version.

We therefore add a /v2 suffix to our module path and all its
instances in import paths.

See also https://golang.org/ref/mod#major-version-suffixes for
details regarding the Go module system's major version suffix rule.
2021-08-09 23:18:38 -07:00
brian m. carlson
da4fdef00b
Support SHA-256 repositories
Git will start to support SHA-256 as a hash for repositories in the near
future.  Let's update gitobj to version 2 to support SHA-256
repositories properly.  We initialize the repository based on the
extensions.objectFormat value, if one is provided, since this is the
configuration key that represents the hash algorithm.

Vendor the proper dependencies in place.
2020-07-29 20:53:44 +00:00
brian m. carlson
e3fcde746a git: replace object scanner with one based on gitobj
Currently, our object scanner is based on calling git cat-file --batch.
This is less efficient than reading the objects ourselves in process, so
update the object scanner to use our gitobj package instead.

Remove the reset function from the object scanner, since it is no longer
used.  Also, since we no longer need to worry about reading too much
data from git cat-file --batch, switch the io.LimitedReader to a plain
io.Reader to simplify the code.

Note that in the tests we now specify the object ID of the pointer item
to scan since we no longer can implicitly read from a fake buffer.
Consequently, we no longer look for a trailing entry, since that won't
succeed anymore.
2018-09-11 18:43:27 +00:00
Taylor Blau
2e7646b98b lfs: rename CatFileBatchScanner to PointerScanner 2017-04-04 14:35:03 -06:00