MCPcopy Create free account
hub / github.com/docker/buildx / TestGit

Function TestGit

util/gitutil/gitutil_test.go:13–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestGit(t *testing.T) {
14 ctx := context.TODO()
15 gittestutil.Mktmp(t)
16 c, err := gitutil.New()
17 require.NoError(t, err)
18
19 gittestutil.GitInit(c, t)
20 gittestutil.GitCommit(c, t, "bar")
21
22 out, err := c.Run(ctx, "status")
23 require.NoError(t, err)
24 require.NotEmpty(t, out)
25
26 out, err = c.Run(ctx, "not-exist")
27 require.Error(t, err)
28 require.Empty(t, out)
29 require.Contains(t, err.Error(), "git: 'not-exist' is not a git command. See 'git --help'.")
30}
31
32func TestGitFullCommit(t *testing.T) {
33 ctx := context.TODO()

Callers

nothing calls this directly

Calls 6

MktmpFunction · 0.92
NewFunction · 0.92
GitInitFunction · 0.92
GitCommitFunction · 0.92
RunMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…