feat(clone): add repository cloning flow to UI and backend
This introduces a new Tauri command to clone a remote repository into a validated destination folder, then return the full repository bundle for immediate rendering. The Svelte app gains a clone dialog and a new action in repository management, wiring the cloned bundle into existing refresh helpers. Dialog backdrops were also adjusted to rely on explicit close controls. - Add clone_repository command and core cloning logic in Rust - Create CloneRepositoryDialog and integrate it into App.svelte - Improve clone-related styling and tighten dialog backdrop behavior
This commit is contained in:
@@ -34,6 +34,20 @@ export function openRepositoryBundle(path: string, commitLimit = 100): Promise<R
|
||||
return invoke<RepositoryBundle>("open_repository_bundle", { path, commitLimit });
|
||||
}
|
||||
|
||||
export function cloneRepository(
|
||||
remoteUrl: string,
|
||||
parentPath: string,
|
||||
directoryName?: string,
|
||||
commitLimit = 100,
|
||||
): Promise<RepositoryBundle> {
|
||||
return invoke<RepositoryBundle>("clone_repository", {
|
||||
remoteUrl,
|
||||
parentPath,
|
||||
directoryName: directoryName?.trim() ? directoryName.trim() : null,
|
||||
commitLimit,
|
||||
});
|
||||
}
|
||||
|
||||
export function getStatus(path: string): Promise<GitStatus> {
|
||||
return invoke<GitStatus>("get_status", { path });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user