This commit is contained in:
Ian Gulliver
2026-10-21 08:52:31 -07:00
parent 6a949dc448
commit 485acc1bf9
3 changed files with 16 additions and 31 deletions
+1 -13
View File
@@ -2,7 +2,6 @@ package git
import (
"bufio"
"context"
"fmt"
"io"
"os"
@@ -147,7 +146,7 @@ func RewriteNotes(repo string, rewrite func(string) string) error {
}
func catBlobs(repo string, shas []string) (map[string]string, error) {
out, err := runRaw(repo, strings.Join(shas, "\n")+"\n", "cat-file", "--batch")
out, err := runRaw(repo, nil, strings.Join(shas, "\n")+"\n", "cat-file", "--batch")
if err != nil {
return nil, err
}
@@ -182,14 +181,3 @@ func splitLines(out string) []string {
}
return strings.Split(out, "\n")
}
func runRaw(dir, input string, args ...string) (string, error) {
out, stderr, code, err := runCodeInput(context.Background(), dir, nil, strings.NewReader(input), args...)
if err != nil {
return "", err
}
if code != 0 {
return "", fmt.Errorf("git %s: exit status %d: %s", strings.Join(args, " "), code, stderr)
}
return out, nil
}