Skip to content

Commit 2d1443d

Browse files
saphidclaude
authored andcommitted
fix(server): new projects are created when core.safecrlf refuses LF files
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 07a1e79 commit 2d1443d

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎apps/server/src/project/ManagedProjectFolders.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,12 @@ it.effect("starts a named project as a committed repository, and suffixes a take
349349
const path = yield* Path.Path;
350350
const root = path.resolve(baseDir, "projects");
351351
assert.equal(folders.namedProjectsRoot, root);
352+
const attributes = path.join(baseDir, "crlf.gitattributes");
353+
const crlfConfig = path.join(baseDir, "crlf.gitconfig");
354+
yield* fileSystem.writeFileString(attributes, "* text=auto eol=crlf\n");
355+
yield* git(baseDir, ["config", "--file", crlfConfig, "core.safecrlf", "true"]);
356+
yield* git(baseDir, ["config", "--file", crlfConfig, "core.attributesFile", attributes]);
357+
process.env.GIT_CONFIG_GLOBAL = crlfConfig;
352358

353359
const first = yield* folders.createNamedProject({ name: "Pinball Stats" });
354360
const second = yield* folders.createNamedProject({ name: "pinball stats" });

‎apps/server/src/project/ManagedProjectFolders.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,12 @@ const make = Effect.gen(function* () {
395395
path.join(cwd, "assets", "icon.svg"),
396396
namedProjectIconSvg(name),
397397
);
398-
// Force explicit filenames so global ignore rules cannot drop them.
398+
// Force explicit filenames so global ignore rules cannot drop them, and keep
399+
// core.safecrlf=true from refusing the LF files under CRLF conversion.
399400
yield* git.execute({
400401
operation: "ManagedProjectFolders.add",
401402
cwd,
402-
args: ["add", "--force", "--", "README.md", "assets/icon.svg"],
403+
args: ["-c", "core.safecrlf=false", "add", "--force", "--", "README.md", "assets/icon.svg"],
403404
timeoutMs: 10_000,
404405
});
405406
return yield* git

0 commit comments

Comments
 (0)