fix(client): show git's own error instead of exit status

This commit is contained in:
hh committed 2026-09-20 00:11:58 +02:00
1 parent 95fc50e2c2
commit ae76eab797
1 file changed
+4
+4
View File
@@ -22,6 +22,10 @@ type Repo struct {
func run(dir string, args ...string) (string, error) { func run(dir string, args ...string) (string, error) {
out, err := exec.Command("git", append([]string{"-C", dir}, args...)...).Output() out, err := exec.Command("git", append([]string{"-C", dir}, args...)...).Output()
var failed *exec.ExitError
if errors.As(err, &failed) && len(failed.Stderr) > 0 {
err = errors.New(strings.TrimPrefix(strings.TrimSpace(string(failed.Stderr)), "fatal: "))
}
return strings.TrimRight(string(out), "\n"), err return strings.TrimRight(string(out), "\n"), err
} }