MCPcopy Create free account
hub / github.com/cli/cli / runGit

Function runGit

pkg/cmd/repo/sync/sync_test.go:249–257  ·  view source on GitHub ↗
(t *testing.T, repoDir string, args ...string)

Source from the content-addressed store, hash-verified

247}
248
249func runGit(t *testing.T, repoDir string, args ...string) string {
250 t.Helper()
251 client := &git.Client{RepoDir: repoDir}
252 cmd, err := client.Command(stdctx.Background(), args...)
253 require.NoError(t, err)
254 output, err := cmd.Output()
255 require.NoErrorf(t, err, "git %s failed", strings.Join(args, " "))
256 return strings.TrimSpace(string(output))
257}
258
259func Test_SyncRun(t *testing.T) {
260 tests := []struct {

Calls 4

CommandMethod · 0.95
JoinMethod · 0.80
HelperMethod · 0.65
OutputMethod · 0.65

Tested by

no test coverage detected