(t *testing.T)
| 1410 | } |
| 1411 | |
| 1412 | func TestClientCloneUsesExplicitBareTarget(t *testing.T) { |
| 1413 | // Given a populated local remote and an empty destination parent |
| 1414 | source := newTestRepo(t) |
| 1415 | remote := newBareTestRepo(t) |
| 1416 | source.commit(t, "remote commit") |
| 1417 | source.run(t, "remote", "add", "origin", remote.fileURL()) |
| 1418 | source.run(t, "push", "--quiet", "origin", "trunk") |
| 1419 | parentDir := t.TempDir() |
| 1420 | client := &Client{} |
| 1421 | |
| 1422 | // When the remote is cloned as bare with an explicit target |
| 1423 | target, err := client.Clone(t.Context(), remote.fileURL(), []string{"custom-target", "--bare"}, WithRepoDir(parentDir)) |
| 1424 | |
| 1425 | // Then the reported and created directory use the explicit target |
| 1426 | require.NoError(t, err) |
| 1427 | assert.Equal(t, "custom-target", target) |
| 1428 | assert.Equal(t, "true", runGitAt(t, filepath.Join(parentDir, target), "rev-parse", "--is-bare-repository")) |
| 1429 | } |
| 1430 | |
| 1431 | func TestClientCloneReportsMissingRepository(t *testing.T) { |
| 1432 | // Given a local repository URL that does not exist |
nothing calls this directly
no test coverage detected