CTX7-1927: add depth option to git.clone for shallow clones - #215
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for shallow clones in the JS SDK by introducing an optional depth parameter to git.clone, enabling significantly faster clones for large repositories when depth: 1 is used (while remaining backwards compatible when omitted).
Changes:
- Added
depth?: numbertoGitCloneOptionswith inline documentation. - Passed
depththrough to the/git/clonerequest payload. - Added unit tests covering inclusion and omission of the
depthfield. - Added a changeset for a patch release of
@upstash/box.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/sdk/src/types.ts | Extends GitCloneOptions with an optional depth field and documents its behavior. |
| packages/sdk/src/client.ts | Includes depth in the git clone request body sent to the backend. |
| packages/sdk/src/tests/box-git.test.ts | Adds tests verifying depth is sent when provided and omitted when not. |
| .changeset/git-clone-depth-option.md | Declares a patch changeset for publishing the new option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alitariksahin
approved these changes
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds `depth?: number` to `GitCloneOptions`, passed through as `depth` in the clone request. `depth: 1` produces a shallow clone — dramatically faster for large repos (a 4.8 GB repo that timed out as a full clone completes shallow in ~20s).