MCPcopy
hub / github.com/cli/cli / createCommitsCommandContext

Function createCommitsCommandContext

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

Source from the content-addressed store, hash-verified

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

Callers 1

TestClientCommitsFunction · 0.85

Calls 1

HelperMethod · 0.65

Tested by

no test coverage detected