feat(healthcheck): git lfs with safe.directory
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

This commit is contained in:
张泊明518370910136 2025-06-28 09:50:17 -04:00
parent d19271c7ef
commit 8ca0125f23
GPG Key ID: D47306D7062CDA9D

View File

@ -1,15 +1,27 @@
package healthcheck
import (
"fmt"
"os/exec"
)
func RepoLFS(rootDir string) error {
// cmd := exec.Command("git", "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,
// )
// }
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
}