JOJ3/pkg/healthcheck/repolfs.go
张泊明518370910136 8ca0125f23
All checks were successful
submodules sync / sync (push) Successful in 40s
build / build (push) Successful in 2m52s
build / trigger-build-image (push) Successful in 12s
feat(healthcheck): git lfs with safe.directory
2025-06-28 09:50:17 -04:00

28 lines
383 B
Go

package healthcheck
import (
"fmt"
"os/exec"
)
func RepoLFS(rootDir string) error {
cmd := exec.Command(
"git",
"-c",
"safe.directory=*",
"lfs",
"fsck",
"--pointers",
)
cmd.Dir = rootDir
output, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf(
"error running `git lfs fsck --pointers`: %w, output: %s",
err,
output,
)
}
return nil
}