Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): checkpoint reuse handles filenames starting with a colon #42472

Mergedonly21mil(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/42472/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 23 additions and 4 deletions.

x
0 of 2 viewed, 2 left
18 additions and 2 deletionsapps/server/src/vcs/GitVcsDriver.test.tsModified
View file
@@ -847,9 +847,25 @@
change: ({ git, checkpointRef }: UntrackedBlobChange) =>
git(["update-ref", "-d", checkpointRef]).pipe(Effect.andThen(git(["prune", "--expire=now"]))),
+ ...(HostProcess.Platform.defaultValue() === "win32"
+ ? []
+ : [
+ {
+ name: "it became ignored under a name that looks like a git pathspec",
+ file: ":large.txt",
+ reuses: false,
+ change: ({ write }: UntrackedBlobChange) => write(".gitignore", ":large.txt\n"),
+ },
+ {
+ name: "its name looks like git pathspec magic",
+ file: ":(magic)",
+ reuses: true,
+ change: () => Effect.void,
+ },
+ ]),
])(
"checkpoint capture skips hashing an untracked file only while a fresh hash would match: $name",
- ({ reuses, change, during }) =>
+ ({ file = "nested/large.txt", reuses, change, during }) =>
Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
@@ -877,7 +893,7 @@
const write = (relativePath: string, contents: string) =>