MCPcopy Index your code
hub / github.com/devspace-sh/devspace / TestGitCliBranch

Function TestGitCliBranch

pkg/util/git/git_test.go:46–78  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

44}
45
46func TestGitCliBranch(t *testing.T) {
47 tempDir := t.TempDir()
48
49 gitRepo, err := NewGitCLIRepository(context.Background(), tempDir)
50 if err != nil {
51 t.Fatal(err)
52 }
53
54 err = gitRepo.Clone(context.Background(), CloneOptions{
55 URL: testRepo,
56 Branch: testBranch,
57 })
58 if err != nil {
59 t.Fatal(err)
60 }
61
62 err = gitRepo.Clone(context.Background(), CloneOptions{
63 URL: testRepo,
64 Branch: testBranch,
65 DisableShallow: true,
66 })
67 if err != nil {
68 t.Fatal(err)
69 }
70
71 remote, err := GetRemote(tempDir)
72 if err != nil {
73 t.Fatal(err)
74 }
75 if remote != testRepo {
76 t.Fatalf("Wrong remote, got %s, expected %s", remote, testRepo)
77 }
78}
79
80func TestGoGit(t *testing.T) {
81 tempDir := t.TempDir()

Callers

nothing calls this directly

Calls 5

CloneMethod · 0.95
NewGitCLIRepositoryFunction · 0.85
GetRemoteFunction · 0.85
FatalMethod · 0.45
FatalfMethod · 0.45

Tested by

no test coverage detected