Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions npm/lib.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,15 @@ export type BitResetMode = "soft" | "mixed" | "hard";
export interface BitFetchOptions {
refspec?: string;
preferV2?: boolean;
depth?: number;
preferredSender?: string;
preferredRepo?: string;
authToken?: string;
}

export interface BitCloneOptions {
preferV2?: boolean;
depth?: number;
preferredSender?: string;
preferredRepo?: string;
authToken?: string;
Expand Down
2 changes: 2 additions & 0 deletions npm/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,7 @@ export const fetch = async (
toTransportId(transport),
options.refspec ?? "",
options.preferV2 !== false,
options.depth ?? 0,
),
);
};
Expand Down Expand Up @@ -1061,6 +1062,7 @@ export const clone = async (
resolvedRemoteUrl,
toTransportId(transport),
options.preferV2 !== false,
options.depth ?? 0,
),
);
};
Expand Down
12 changes: 8 additions & 4 deletions src/lib/js_api_exports.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,7 @@ pub async fn js_clone_remote(
remote_url : String,
transport_id : Int,
prefer_v2 : Bool,
depth : Int,
) -> Result[JsCloneResult, String] {
let fs = js_make_host_fs(host_id)
js_wrap_error_async(async fn() -> JsCloneResult raise @bit.GitError {
Expand Down Expand Up @@ -1429,7 +1430,7 @@ pub async fn js_clone_remote(
remote_url,
wants,
prefer_v2,
0,
depth,
@protocol.FilterSpec::NoFilter,
async fn(
url : String,
Expand Down Expand Up @@ -1486,9 +1487,10 @@ pub fn js_clone_remote_promise(
remote_url : String,
transport_id : Int,
prefer_v2 : Bool,
depth : Int,
) -> @js_async.Promise[Result[JsCloneResult, String]] {
js_export_promise(async fn() {
js_clone_remote(host_id, root, remote_url, transport_id, prefer_v2)
js_clone_remote(host_id, root, remote_url, transport_id, prefer_v2, depth)
})
}

Expand All @@ -1500,6 +1502,7 @@ pub async fn js_fetch_remote(
transport_id : Int,
refspec : String,
prefer_v2 : Bool,
depth : Int,
) -> Result[JsFetchResult, String] {
let fs = js_make_host_fs(host_id)
js_wrap_error_async(async fn() -> JsFetchResult raise @bit.GitError {
Expand Down Expand Up @@ -1528,7 +1531,7 @@ pub async fn js_fetch_remote(
remote_url,
[commit_id],
prefer_v2,
0,
depth,
@protocol.FilterSpec::NoFilter,
async fn(
url : String,
Expand Down Expand Up @@ -1577,9 +1580,10 @@ pub fn js_fetch_remote_promise(
transport_id : Int,
refspec : String,
prefer_v2 : Bool,
depth : Int,
) -> @js_async.Promise[Result[JsFetchResult, String]] {
js_export_promise(async fn() {
js_fetch_remote(host_id, root, remote_url, transport_id, refspec, prefer_v2)
js_fetch_remote(host_id, root, remote_url, transport_id, refspec, prefer_v2, depth)
})
}

Expand Down
Loading