Audit of f8e6783
This commit is contained in:
+1
-13
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user