fix(httpapi): model optional worktree payload as no content (#29246)

This commit is contained in:
Kit Langton
2026-05-25 15:57:12 -04:00
committed by GitHub
parent a99ebd1d65
commit b46cec2a7d
3 changed files with 26 additions and 4 deletions

View File

@@ -228,6 +228,28 @@ describe("worktree endpoint reproduction", () => {
{ git: true },
)
worktreeTest(
"direct HttpApi worktree create rejects explicit null payload",
() =>
Effect.gen(function* () {
const test = yield* TestInstance
const server = yield* serverScoped()
const response = yield* request(
server,
`${ExperimentalPaths.worktree}?directory=${encodeURIComponent(test.directory)}`,
{
method: "POST",
headers: { "content-type": "application/json" },
body: "null",
},
)
expect(response.status).toBe(400)
}),
{ git: true },
)
worktreeTest(
"workspace worktree create does not hang",
() =>