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

Function prepareGitRepo

script/ghmock/gitcmd_test.go:375–383  ·  view source on GitHub ↗
(t *testing.T, remote string)

Source from the content-addressed store, hash-verified

373}
374
375func prepareGitRepo(t *testing.T, remote string) {
376 t.Helper()
377 require.NoError(t, cmdRepo([]string{"octo/hello"}, io.Discard))
378 gitForTest(t, "--", "clone", "--quiet", remote, "main")
379 require.NoError(t, cmdWrite([]string{"main/example.txt", "--text", "one\n"}, io.Discard))
380 gitForTest(t, "--in", "main", "--", "add", "example.txt")
381 gitForTest(t, "--in", "main", "--", "commit", "--quiet", "-m", "First")
382 gitForTest(t, "--in", "main", "--", "push", "--quiet", "origin", "main")
383}

Callers 3

TestCmdGitFunction · 0.85
TestCmdExportFunction · 0.85
TestRunAllFunction · 0.85

Calls 4

cmdRepoFunction · 0.85
gitForTestFunction · 0.85
cmdWriteFunction · 0.85
HelperMethod · 0.65

Tested by

no test coverage detected