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

Function createCommitsCommandContext

git/client_test.go:694–710  ·  view source on GitHub ↗
(t *testing.T, testData stubbedCommitsCommandData)

Source from the content-addressed store, hash-verified

692}
693
694func createCommitsCommandContext(t *testing.T, testData stubbedCommitsCommandData) (*exec.Cmd, commandCtx) {
695 t.Helper()
696
697 b, err := json.Marshal(testData)
698 require.NoError(t, err)
699
700 cmd := exec.CommandContext(context.Background(), os.Args[0], "-test.run=TestCommitsHelperProcess", "--")
701 cmd.Env = []string{
702 "GH_WANT_HELPER_PROCESS=1",
703 "GH_COMMITS_TEST_DATA=" + string(b),
704 }
705 return cmd, func(ctx context.Context, exe string, args ...string) *exec.Cmd {
706 cmd.Args = append(cmd.Args, exe)
707 cmd.Args = append(cmd.Args, args...)
708 return cmd
709 }
710}
711
712func TestClientLastCommit(t *testing.T) {
713 IsolateConfig(t)

Callers 1

TestClientCommitsFunction · 0.85

Calls 1

HelperMethod · 0.65

Tested by

no test coverage detected