feat(healthcheck): set safe dir in count-objects
All checks were successful
submodules sync / sync (push) Successful in 43s
build / build (push) Successful in 1m26s
build / trigger-build-image (push) Successful in 9s

This commit is contained in:
张泊明518370910136 2025-02-09 10:03:24 -05:00
parent 332bf7d4de
commit 837f9d9981
GPG Key ID: D47306D7062CDA9D

View File

@ -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)