(t *testing.T, repo, objType string, content []byte)
| 319 | } |
| 320 | |
| 321 | func writeLooseObject(t *testing.T, repo, objType string, content []byte) plumbing.Hash { |
| 322 | t.Helper() |
| 323 | cmd := exec.Command("git", "-C", repo, "hash-object", "-w", "--literally", "-t", objType, "--stdin") |
| 324 | cmd.Stdin = bytes.NewReader(content) |
| 325 | var stderr bytes.Buffer |
| 326 | cmd.Stderr = &stderr |
| 327 | out, err := cmd.Output() |
| 328 | require.NoErrorf(t, err, "git hash-object: %s", stderr.String()) |
| 329 | return plumbing.NewHash(strings.TrimSpace(string(out))) |
| 330 | } |
| 331 | |
| 332 | func gitVerifyCommit(t *testing.T, repo string, h plumbing.Hash) error { |
| 333 | t.Helper() |
no test coverage detected
searching dependent graphs…