1
0
forked from JOJ/JOJ3

feat(healthcheck): set safe dir in count-objects

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

View File

@ -13,7 +13,13 @@ import (
func RepoSize(confSize float64) error { func RepoSize(confSize float64) error {
// TODO: reimplement here when go-git is available // TODO: reimplement here when go-git is available
// https://github.com/go-git/go-git/blob/master/COMPATIBILITY.md // 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() output, err := cmd.CombinedOutput()
if err != nil { if err != nil {
slog.Error("running git command:", "err", err, "output", output) slog.Error("running git command:", "err", err, "output", output)