(t *testing.T)
| 156 | } |
| 157 | |
| 158 | func TestCommitAndSafePush_WithSubpath(t *testing.T) { |
| 159 | tempDir, remoteDir := setupMonorepoTestRepository(t) |
| 160 | h := minimalHelper() |
| 161 | |
| 162 | // Create local changes in subproject1 (uncommitted) |
| 163 | createFile(t, tempDir, "subproject1/local.txt", "local content") |
| 164 | |
| 165 | // Create remote changes in subproject1 |
| 166 | createRemoteCommit(t, remoteDir, "subproject1/remote.txt", "remote content", "add remote file to subproject1") |
| 167 | |
| 168 | config := &gitutil.Config{ |
| 169 | Remote: remoteDir, |
| 170 | DefaultBranch: getCurrentBranch(t, tempDir), |
| 171 | Subpath: "subproject1", |
| 172 | } |
| 173 | |
| 174 | err := h.CommitAndSafePush(context.Background(), tempDir, config, "test commit", author, "1") |
| 175 | require.NoError(t, err, "CommitAndSafePush should succeed with subpath") |
| 176 | |
| 177 | // Verify both files exist in subproject1 |
| 178 | assertFileExists(t, tempDir, "subproject1/local.txt") |
| 179 | assertFileExists(t, tempDir, "subproject1/remote.txt") |
| 180 | } |
| 181 | |
| 182 | func TestCommitAndSafePush_SubpathIsolation(t *testing.T) { |
| 183 | tempDir, remoteDir := setupMonorepoTestRepository(t) |
nothing calls this directly
no test coverage detected