aboutsummaryrefslogtreecommitdiff
path: root/testutil_sha256_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'testutil_sha256_test.go')
-rw-r--r--testutil_sha256_test.go29
1 files changed, 0 insertions, 29 deletions
diff --git a/testutil_sha256_test.go b/testutil_sha256_test.go
deleted file mode 100644
index db5cb40d..00000000
--- a/testutil_sha256_test.go
+++ /dev/null
@@ -1,29 +0,0 @@
-//go:build !sha1
-
-package furgit
-
-import (
- "os"
- "os/exec"
- "testing"
-)
-
-func setupTestRepo(t *testing.T) (string, func()) {
- t.Helper()
- tempDir, err := os.MkdirTemp("", "furgit-test-*.git")
- if err != nil {
- t.Fatalf("failed to create temp dir: %v", err)
- }
- cleanup := func() {
- _ = os.RemoveAll(tempDir)
- }
-
- cmd := exec.Command("git", "init", "--object-format=sha256", "--bare", tempDir)
- cmd.Env = append(os.Environ(), "GIT_CONFIG_GLOBAL=/dev/null", "GIT_CONFIG_SYSTEM=/dev/null")
- if output, err := cmd.CombinedOutput(); err != nil {
- cleanup()
- t.Fatalf("failed to init git repo: %v\n%s", err, output)
- }
-
- return tempDir, cleanup
-}