Skip to content

CTX7-1927: add depth option to git.clone for shallow clones - #215

Merged
fahreddinozcan merged 8 commits into
mainfrom
ctx7-1927-shallow-clone-option-for-box
Aug 5, 2026
Merged

CTX7-1927: add depth option to git.clone for shallow clones#215
fahreddinozcan merged 8 commits into
mainfrom
ctx7-1927-shallow-clone-option-for-box

Conversation

@fahreddinozcan

Copy link
Copy Markdown
Contributor

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).

  • Omitted = full clone; fully backward compatible
  • Requires server support from upstash/box-backend#228 — deploy that first; older servers ignore the extra field (full clone)

@linear-code

linear-code Bot commented Aug 3, 2026

Copy link
Copy Markdown

CTX7-1927

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?: number to GitCloneOptions with inline documentation.
  • Passed depth through to the /git/clone request payload.
  • Added unit tests covering inclusion and omission of the depth field.
  • 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.

@fahreddinozcan
fahreddinozcan merged commit a419844 into main Aug 5, 2026
11 checks passed
@fahreddinozcan
fahreddinozcan deleted the ctx7-1927-shallow-clone-option-for-box branch August 5, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants