(t *testing.T)
| 44 | } |
| 45 | |
| 46 | func 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 | |
| 80 | func TestGoGit(t *testing.T) { |
| 81 | tempDir := t.TempDir() |
nothing calls this directly
no test coverage detected