Skip to content

Instantly share code, notes, and snippets.

@konsta95
Created October 2, 2026 11:23
Show Gist options
  • Select an option

  • Save konsta95/f0acc40a7acdccd0394e67c326c16159 to your computer and use it in GitHub Desktop.

Select an option

Save konsta95/f0acc40a7acdccd0394e67c326c16159 to your computer and use it in GitHub Desktop.
Three additions anthropics/claude-code#97293 needs after a rebase onto main

Three additions #97293 needs after a rebase onto main

For anthropics/claude-code#97293, "mods: the declarations carry process.run's truncation flags and list entries' mtimeMs; the test fakes answer them".

Main has moved under the PR in three places since it was opened.

Spot Needs Why
mods/diff/tests/fixtures/git-in.ts:38 isStdoutTruncated, isStderrTruncated Main rewrote the function, so the PR's hunk no longer applies
mods/diff/tests/fixtures/old-files.ts:15 mtimeMs Same
mods/diff/tests/register.test.ts:16 mtimeMs The listing is newer than the PR

Apply

After rebasing onto main and keeping main's text in the two conflicting fixtures:

git apply three-spots.patch

Measured

Main 52c7644, PR head 61eb858, TypeScript 5.9.3, Claude Code 2.1.287, Linux.

Tree tsc -p mods/tsconfig.json claude plugin test mods/diff claude plugin test mods/telemetry
main + the PR 3 errors not run not run
main + the PR + this patch 0 errors 210 pass, 0 fail 34 pass, 0 fail

"main + the PR" is the PR's diff applied onto main, with main's text kept where its two fixture hunks no longer apply. It was not produced by rebasing the branch.

diff --git a/mods/diff/tests/fixtures/git-in.ts b/mods/diff/tests/fixtures/git-in.ts
index c3533c2..3b6a271 100644
--- a/mods/diff/tests/fixtures/git-in.ts
+++ b/mods/diff/tests/fixtures/git-in.ts
@@ -35,5 +35,13 @@ export function gitIn(
const isKnown = stdout !== undefined
- return isKnown ? { exitCode: 0, stdout, stderr: '' } : NOT_A_REPOSITORY
+ return isKnown
+ ? {
+ exitCode: 0,
+ stdout,
+ stderr: '',
+ isStdoutTruncated: false,
+ isStderrTruncated: false,
+ }
+ : NOT_A_REPOSITORY
}
diff --git a/mods/diff/tests/fixtures/old-files.ts b/mods/diff/tests/fixtures/old-files.ts
index a500101..c1d9a87 100644
--- a/mods/diff/tests/fixtures/old-files.ts
+++ b/mods/diff/tests/fixtures/old-files.ts
@@ -16,6 +16,7 @@ export function oldFiles(
name,
kind: 'file' as const,
size: 2,
+ mtimeMs: 0,
isLink: false,
})),
}))
diff --git a/mods/diff/tests/register.test.ts b/mods/diff/tests/register.test.ts
index 124f6d8..99838bb 100644
--- a/mods/diff/tests/register.test.ts
+++ b/mods/diff/tests/register.test.ts
@@ -17,6 +17,7 @@ describe('register', () => {
name,
kind,
size: 0,
+ mtimeMs: 0,
isLink: false,
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment