aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-06-06 18:31:42 +0000
committerGravatar Runxi Yu2026-06-06 18:31:42 +0000
commitdbd57451f169b0b76f71ca9c34c52f447aa0ff3b (patch)
tree4b50dd2a82e5dd8ff215cac4e0d8c252df11e367
parentref: Add (diff)
signatureNo signature
internal/testgit: Maybe SHA-256 repos by default
-rw-r--r--internal/testgit/repo.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/testgit/repo.go b/internal/testgit/repo.go
index fa89c022..940ba1e1 100644
--- a/internal/testgit/repo.go
+++ b/internal/testgit/repo.go
@@ -20,9 +20,14 @@ type RepoOptions struct {
func NewRepo(tb testing.TB, opts RepoOptions) (*Repo, error) {
tb.Helper()
+ objectFormat := opts.ObjectFormat
+ if objectFormat == id.ObjectFormatUnknown {
+ objectFormat = id.ObjectFormatSHA256
+ }
+
repo := &Repo{
path: tb.TempDir(),
- objectFormat: opts.ObjectFormat,
+ objectFormat: objectFormat,
env: append(os.Environ(),
"GIT_CONFIG_GLOBAL=/dev/null",
"GIT_CONFIG_SYSTEM=/dev/null",