Add local batched Git blob reader
This commit is contained in:
@@ -164,7 +164,7 @@ type remoteFixture struct {
|
||||
commit string
|
||||
}
|
||||
|
||||
func newRemoteFixture(t *testing.T) remoteFixture {
|
||||
func newRemoteFixture(t testing.TB) remoteFixture {
|
||||
t.Helper()
|
||||
base := t.TempDir()
|
||||
work := filepath.Join(base, "work")
|
||||
@@ -194,7 +194,7 @@ func resolveFixture(t *testing.T, repo remoteFixture) Endpoint {
|
||||
return endpoint
|
||||
}
|
||||
|
||||
func gitRun(t *testing.T, dir string, args ...string) {
|
||||
func gitRun(t testing.TB, dir string, args ...string) {
|
||||
t.Helper()
|
||||
cmd := exec.Command("git", args...)
|
||||
cmd.Dir = dir
|
||||
@@ -203,7 +203,7 @@ func gitRun(t *testing.T, dir string, args ...string) {
|
||||
}
|
||||
}
|
||||
|
||||
func gitText(t *testing.T, dir string, args ...string) string {
|
||||
func gitText(t testing.TB, dir string, args ...string) string {
|
||||
t.Helper()
|
||||
cmd := exec.Command("git", args...)
|
||||
cmd.Dir = dir
|
||||
@@ -214,7 +214,7 @@ func gitText(t *testing.T, dir string, args ...string) string {
|
||||
return strings.TrimSuffix(string(outputBytes), "\n")
|
||||
}
|
||||
|
||||
func writeRepoFile(t *testing.T, repoDir, name, contents string) {
|
||||
func writeRepoFile(t testing.TB, repoDir, name, contents string) {
|
||||
t.Helper()
|
||||
path := filepath.Join(repoDir, name)
|
||||
if err := os.WriteFile(path, []byte(contents), 0o644); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user