From 837f9d9981ae1ceaf7b3cd2cd8cbd4b00219d30d Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Sun, 9 Feb 2025 10:03:24 -0500 Subject: [PATCH] feat(healthcheck): set safe dir in count-objects --- pkg/healthcheck/reposize.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/healthcheck/reposize.go b/pkg/healthcheck/reposize.go index dde0e4d..16704a4 100644 --- a/pkg/healthcheck/reposize.go +++ b/pkg/healthcheck/reposize.go @@ -13,7 +13,13 @@ import ( func RepoSize(confSize float64) error { // TODO: reimplement here when go-git is available // https://github.com/go-git/go-git/blob/master/COMPATIBILITY.md - cmd := exec.Command("git", "count-objects", "-v") + cmd := exec.Command( + "git", + "-c", + "safe.directory='*'", + "count-objects", + "-v", + ) output, err := cmd.CombinedOutput() if err != nil { slog.Error("running git command:", "err", err, "output", output)