(t *testing.T)
| 24 | } |
| 25 | |
| 26 | func TestCommitAndSafePush_NoRemoteCommits(t *testing.T) { |
| 27 | tempDir, _ := setupTestRepository(t) |
| 28 | h := minimalHelper() |
| 29 | |
| 30 | // Create local changes |
| 31 | createCommit(t, tempDir, "new-file.txt", "new content", "add new file") |
| 32 | |
| 33 | config := &gitutil.Config{ |
| 34 | Remote: filepath.Join(tempDir, ".git"), |
| 35 | DefaultBranch: getCurrentBranch(t, tempDir), |
| 36 | Subpath: "", |
| 37 | } |
| 38 | |
| 39 | err := h.CommitAndSafePush(context.Background(), tempDir, config, "test commit", author, "1") |
| 40 | require.NoError(t, err, "CommitAndSafePush should succeed with no remote commits") |
| 41 | // verify file exists locally and was pushed |
| 42 | assertFileExists(t, tempDir, "new-file.txt") |
| 43 | } |
| 44 | |
| 45 | func TestCommitAndSafePush_WithRemoteCommits_DefaultChoice1(t *testing.T) { |
| 46 | tempDir, remoteDir := setupTestRepository(t) |
nothing calls this directly
no test coverage detected