feat(git): add advanced clone options (shallow, sparse, flags)

Add advanced clone options support across the frontend and backend.
Users can specify a branch, shallow limits, blobless mode, sparse paths,
and custom clone flags when initiating a clone operation. The backend
validates inputs, parses custom flags without invoking a shell, and
configures sparse checkouts after a successful clone. A small parsing
dependency was added and tracked-file parsing was improved to better
handle git ls-files output.

- Introduce CloneRunOptions and validation helpers for clone inputs
- Parse custom flags with a shell-like tokenizer and block managed flags
- Support sparse checkout configuration and shallow clone constraints
This commit is contained in:
2026-08-31 19:43:30 +02:00
parent 4c58b14691
commit 90df347e4a
7 changed files with 455 additions and 15 deletions
+10
View File
@@ -161,6 +161,16 @@ export interface GitRemote { name: string; fetch_url: string; push_url: string;
export type PullStrategy = "merge" | "rebase" | "ff-only";
export type MergeStrategy = "default" | "squash" | "ff-only" | "no-ff";
export interface CloneOptions {
branch: string | null;
blobless: boolean;
customFlags: string;
shallowDepth: number | null;
shallowSince: string | null;
sparse: boolean;
sparsePaths: string[];
}
export interface GitFileStatus {
path: string;
old_path: string | null;