Showing the changes to apps/server/src/sourceControl/SourceControlRepositoryService.ts (1 of 6 files). Show all
Unified · Split
| @@ -224,19 +224,25 @@ export const make = Effect.gen(function* () { · 223 unmodified lines | ||
| 224 | 224 | ); |
| 225 | 225 | if (headCommit === null) return false; |
| 226 | 226 | |
| 227 | − const remoteCommits = yield* git | |
| 227 | + const remoteCommit = yield* git | |
| 228 | 228 | .execute({ |
| 229 | 229 | operation: "SourceControlRepositoryService.cloneRepository.verifyRemoteRefs", |
| 230 | 230 | cwd: destinationPath, |
| 231 | − args: ["for-each-ref", "--format=%(objectname)", "refs/remotes/origin"], | |
| 231 | + args: [ | |
| 232 | + "for-each-ref", | |
| 233 | + "--count=1", | |
| 234 | + "--format=%(objectname)", | |
| 235 | + `--points-at=${headCommit}`, | |
| 236 | + "refs/remotes/origin", | |
| 237 | + ], | |
| 232 | 238 | timeoutMs: 5_000, |
| 233 | − maxOutputBytes: 64 * 1024, | |
| 239 | + maxOutputBytes: 1024, | |
| 234 | 240 | }) |
| 235 | 241 | .pipe( |
| 236 | − Effect.map((result) => new Set(result.stdout.split("\n").map((line) => line.trim()))), | |
| 237 | − Effect.orElseSucceed(() => new Set<string>()), | |
| 242 | + Effect.map((result) => result.stdout.trim() || null), | |
| 243 | + Effect.orElseSucceed(() => null), | |
| 238 | 244 | ); |
| 239 | − if (!remoteCommits.has(headCommit)) return false; | |
| 245 | + if (remoteCommit !== headCommit) return false; | |
| 240 | 246 | |
| 241 | 247 | return yield* git |
| 242 | 248 | .execute({ |