The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 18:00 UTC
fix(server): end clone options before the repository URL (#14781)
Alex Southwell committed
Oct 6, 2026 at 20:22 UTC
e65063ccf6ce83aa33d10521aeaf929210f0ff04
2 files changed
+45
-2
apps/server/src/sourceControl/SourceControlRepositoryService.test.ts
+38
-1
@@ -179,7 +179,7 @@ it.effect("clones a looked-up repository into the requested destination", () =>
179
assert.deepStrictEqual(cloneCalls, [
180
{
181
cwd: parent,
182
- args: ["clone", "--progress", CLONE_URLS.url, "t3code"],
182
+ args: ["clone", "--progress", "--", CLONE_URLS.url, "t3code"],
183
},
184
]);
185
}).pipe(
@@ -198,6 +198,43 @@ it.effect("clones a looked-up repository into the requested destination", () =>
198
}).pipe(Effect.provide(NodeServices.layer)),
199
);
200
201
+it.effect.each(["--bare", "source.git"])(
202
+ "clones a local repository named %s as a working tree",
203
+ (repositoryName) =>
204
+ Effect.gen(function* () {
205
+ const fs = yield* FileSystem.FileSystem;
206
+ const path = yield* Path.Path;
207
+ const git = yield* GitVcsDriver.GitVcsDriver;
208
+ const parent = yield* fs.makeTempDirectoryScoped({ prefix: "t3-clone-options-" });
209
+ yield* git.execute({
210
+ operation: "test.init",
211
+ cwd: parent,
212
+ args: ["init", "--bare", path.join(parent, repositoryName)],
213
+ });
214
+ const destinationPath = path.join(parent, "checkout");
215
+ yield* Effect.gen(function* () {
216
+ const service = yield* SourceControlRepositoryService.SourceControlRepositoryService;
217
+ const result = yield* service.cloneRepository({
218
+ remoteUrl: repositoryName,
219
+ destinationPath,
220
+ });
221
+ assert.strictEqual(result.cwd, destinationPath);
222
+ assert.isTrue(yield* fs.exists(path.join(destinationPath, ".git")));
223
+ }).pipe(Effect.provide(makeLayer({ git: { execute: git.execute } })));
224
+ }).pipe(
225
+ Effect.provide(
226
+ GitVcsDriver.layer.pipe(
227
+ Layer.provide(
228
+ ServerConfig.layerTest(process.cwd(), {
229
+ prefix: "t3-clone-options-config-",
230
+ }),
231
+ ),
232
+ Layer.provideMerge(NodeServices.layer),
233
+ ),
234
+ ),
235
+ ),
236
+);
237
+
238
it.effect("reports clone progress from git's stderr and keeps its error text on failure", () =>
239
Effect.gen(function* () {
240
const fs = yield* FileSystem.FileSystem;
apps/server/src/sourceControl/SourceControlRepositoryService.ts
+7
-1
@@ -303,7 +303,13 @@ export const make = Effect.gen(function* () {
303
.execute({
304
operation: "SourceControlRepositoryService.cloneRepository",
305
cwd: path.dirname(prepared.destinationPath),
306
- args: ["clone", "--progress", prepared.cloneUrl, path.basename(prepared.destinationPath)],
306
+ args: [
307
+ "clone",
308
+ "--progress",
309
+ "--",
310
+ prepared.cloneUrl,
311
+ path.basename(prepared.destinationPath),
312
+ ],
313
timeoutMs: options?.timeoutMs === undefined ? CLONE_TIMEOUT_MS : options.timeoutMs,
314
// Progress redraws add up on a slow multi-GB clone. The buffered copy
315
// is never read (the tail is kept by hand above), so keep it small