Skip to content

Commit 6ada4ee

Browse files
committed
refactor(server): simplify checkpoint record boundary state
1 parent ab00f22 commit 6ada4ee

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

‎apps/server/src/vcs/GitVcsDriver.ts‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -899,9 +899,7 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
899899
env: commitEnv,
900900
maxOutputBytes: 4_096,
901901
outputMode: "truncate",
902-
// The listing has a `<tag> <path>\0` record per index entry (2 MB for 28k files).
903-
// Only tags, and skip-worktree paths in a sparse checkout, are read, so jump
904-
// from one NUL to the next instead of visiting every byte.
902+
// Only tags and sparse skip-worktree paths matter; scan NUL-delimited records.
905903
onStdoutChunk: (chunk) => {
906904
let start = 0;
907905
while (start < chunk.length) {
@@ -927,11 +925,8 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
927925
skippedRecord = [];
928926
}
929927
}
930-
if (end === -1) {
931-
recordStart = false;
932-
break;
933-
}
934-
recordStart = true;
928+
recordStart = end !== -1;
929+
if (!recordStart) break;
935930
start = end + 1;
936931
}
937932
},

0 commit comments

Comments
 (0)