@devries-cameron20 / t3code-1 / commits / 58302b2010
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(git): treat selected commit paths literally (#3998)

Eric Tsai committed Jul 17, 2026 at 19:14 UTC 58302b2010913d6e236570bbe8c9abe38de7fa18
2 files changed +19
apps/server/src/vcs/GitVcsDriverCore.test.ts
+18
@@ -620,6 +620,24 @@ it.layer(TestLayer)("GitVcsDriver core integration", (it) => {
620 assert.notInclude(status, "a.txt");
621 }),
622 );
623 +
624 + it.effect("treats selected file paths literally", () =>
625 + Effect.gen(function* () {
626 + const cwd = yield* makeTmpDir();
627 + yield* initRepoWithCommit(cwd);
628 + const driver = yield* GitVcsDriver.GitVcsDriver;
629 +
630 + yield* writeTextFile(cwd, "selected[1].txt", "literal\n");
631 + yield* writeTextFile(cwd, "selected1.txt", "pattern match\n");
632 +
633 + yield* driver.prepareCommitContext(cwd, ["selected[1].txt"]);
634 +
635 + assert.equal(yield* git(cwd, ["diff", "--cached", "--name-only"]), "selected[1].txt");
636 +
637 + const status = yield* git(cwd, ["status", "--porcelain"]);
638 + assert.include(status, "?? selected1.txt");
639 + }),
640 + );
641 });
642
643 describe("remote operations", () => {
apps/server/src/vcs/GitVcsDriverCore.ts
+1
@@ -1524,6 +1524,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
1524 }),
1525 );
1526 yield* runGit("GitVcsDriver.prepareCommitContext.addSelected", cwd, [
1527 + "--literal-pathspecs",
1528 "add",
1529 "-A",
1530 "--",