Skip to content

Commit c6349aa

Browse files
authored
Fix options parameter types for gitCheckout (#286)
* Update `gitCheckout` method to make `options` parameter optional * Added changeset
1 parent 472d5ae commit c6349aa

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changeset/funny-beans-exist.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudflare/sandbox': patch
3+
---
4+
5+
Fix `options` parameter types for `gitCheckout`

packages/sandbox/src/sandbox.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,12 +1868,12 @@ export class Sandbox<Env = unknown> extends Container<Env> implements ISandbox {
18681868

18691869
async gitCheckout(
18701870
repoUrl: string,
1871-
options: { branch?: string; targetDir?: string; sessionId?: string }
1871+
options?: { branch?: string; targetDir?: string; sessionId?: string }
18721872
) {
1873-
const session = options.sessionId ?? (await this.ensureDefaultSession());
1873+
const session = options?.sessionId ?? (await this.ensureDefaultSession());
18741874
return this.client.git.checkout(repoUrl, session, {
1875-
branch: options.branch,
1876-
targetDir: options.targetDir
1875+
branch: options?.branch,
1876+
targetDir: options?.targetDir
18771877
});
18781878
}
18791879

0 commit comments

Comments
 (0)