Skip to content

Commit d777b6d

Browse files
Tabonxclaude
andcommitted
fix(azure-devops): local pull request checkout no longer fails on --detect
`az repos pr checkout` has no --detect parameter, so every local checkout exited with an argument error. It always reads the organization from the current remote, so dropping the flag is enough. Fixes #31164 Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent a21d788 commit d777b6d

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

‎packages/source-control-azure-devops/src/server/AzureDevOpsCli.test.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,26 @@ describe("AzureDevOpsCli.layer", () => {
233233
}).pipe(Effect.provide(layer)),
234234
);
235235

236+
it.effect("checks out a pull request with only the flags az accepts for that command", () =>
237+
Effect.gen(function* () {
238+
mockRun.mockReturnValueOnce(Effect.succeed(processOutput("")));
239+
240+
const az = yield* AzureDevOpsCli.AzureDevOpsCli;
241+
yield* az.checkoutPullRequest({ cwd: "/repo", reference: "42" });
242+
243+
assert.deepStrictEqual(mockRun.mock.calls.at(-1)?.[0].args, [
244+
"repos",
245+
"pr",
246+
"checkout",
247+
"--only-show-errors",
248+
"--id",
249+
"42",
250+
"--remote-name",
251+
"origin",
252+
]);
253+
}).pipe(Effect.provide(layer)),
254+
);
255+
236256
it.effect("preserves VCS causes without copying upstream details into messages", () =>
237257
Effect.gen(function* () {
238258
const cause = new VcsProcessExitError({

‎packages/source-control-azure-devops/src/server/AzureDevOpsCli.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,6 @@ export const make = Effect.gen(function* () {
565565
"pr",
566566
"checkout",
567567
"--only-show-errors",
568-
"--detect",
569-
"true",
570568
"--id",
571569
normalizeChangeRequestId(input.reference),
572570
"--remote-name",

0 commit comments

Comments
 (0)