| ... | @@ -179,7 +179,7 @@ it.effect("clones a looked-up repository into the requested destination", () => | ... | @@ -179,7 +179,7 @@ it.effect("clones a looked-up repository into the requested destination", () => |
| 179 | assert.deepStrictEqual(cloneCalls, [ | 179 | assert.deepStrictEqual(cloneCalls, [ |
| 180 | { | 180 | { |
| 181 | cwd: parent, | 181 | cwd: parent, |
| 182 | args: ["clone", "--progress", CLONE_URLS.url, "t3code"], | 182 | args: ["clone", "--progress", "--", CLONE_URLS.url, "t3code"], |
| 183 | }, | 183 | }, |
| 184 | ]); | 184 | ]); |
| 185 | }).pipe( | 185 | }).pipe( |
| ... | @@ -198,6 +198,43 @@ it.effect("clones a looked-up repository into the requested destination", () => | ... | @@ -198,6 +198,43 @@ it.effect("clones a looked-up repository into the requested destination", () => |
| 198 | }).pipe(Effect.provide(NodeServices.layer)), | 198 | }).pipe(Effect.provide(NodeServices.layer)), |
| 199 | ); | 199 | ); |
| 200 | | 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 | |
| 201 | it.effect("reports clone progress from git's stderr and keeps its error text on failure", () => | 238 | it.effect("reports clone progress from git's stderr and keeps its error text on failure", () => |
| 202 | Effect.gen(function* () { | 239 | Effect.gen(function* () { |
| 203 | const fs = yield* FileSystem.FileSystem; | 240 | const fs = yield* FileSystem.FileSystem; |