Skip to content

Support SHA-256 repositories without native Git fallback #13

Description

@andrew

clone/gogit currently handles SHA-256 repositories through the native Git fallback. The goal is to use its in-process blob reader against repositories created with the planned Git 3.0 SHA-256 default, including environments where the git binary is unavailable.

At current main (38dd5d96de0badd456ee2cba58db357334822613), the module pins github.com/go-git/go-git/v5 v5.19.2. readBlobWithGoGit rejects object IDs longer than 40 characters with go-git v5 does not support 64-character object IDs. Blob and InspectBlob then invoke native Git. Removing Git from PATH exposes the failure.

Using Git 2.55.0, this reproduces it:

cd gogit
GIT_DEFAULT_HASH=sha256 GIT_DEFAULT_REF_FORMAT=reftable go test ./...

The failing public API tests report both the 64-character object ID error and exec: "git": executable file not found in $PATH. The same run with GIT_DEFAULT_HASH=sha1 and GIT_DEFAULT_REF_FORMAT=reftable succeeds, so reftable alone does not block this object-store reader.

Track the move to go-git v6 after its SHA-256 work is ready:

The change should migrate the module and imports to v6, replace the fixed 40-character assumptions with hash-format-aware handling, and cover Blob and InspectBlob with native Git absent for SHA-256 repositories using both files and reftable reference storage.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockeddependenciesPull requests that update a dependency fileenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions