feat(git): add opt-in for unrelated histories during pull
publish / Build and publish Windows installer (release) Successful in 10m2s
publish / Build and publish Ubuntu AppImage (release) Successful in 10m28s
publish / Build and publish AUR packages (release) Successful in 22m1s

Allow pulling repositories with unrelated commit histories when the user
explicitly opts in. The pull argument construction was refactored and
branch resolution made more robust so the backend can include the
--allow-unrelated-histories flag when requested.

- Extract pull argument logic and add support for allowing unrelated histories.
- Prompt users in the UI to confirm merging separate histories and retry pull.
- Restyle and improve the update toast UI for better layout and responsiveness.
This commit is contained in:
2026-08-30 20:25:15 +02:00
parent 4db6f30461
commit c3762ae7a3
5 changed files with 357 additions and 162 deletions
+18 -2
View File
@@ -405,8 +405,24 @@ export function commitAiSplit(path: string, options: CommitAiGenerateOptions): P
});
}
export function pull(path: string, username?: string, password?: string, strategy: PullStrategy = "merge", remote?: string, branch?: string): Promise<GitStatus> {
return invoke<GitStatus>("pull", { path, username: username ?? null, password: password ?? null, strategy, remote: remote || null, branch: branch || null });
export function pull(
path: string,
username?: string,
password?: string,
strategy: PullStrategy = "merge",
remote?: string,
branch?: string,
allowUnrelatedHistories = false,
): Promise<GitStatus> {
return invoke<GitStatus>("pull", {
path,
username: username ?? null,
password: password ?? null,
strategy,
remote: remote || null,
branch: branch || null,
allowUnrelatedHistories,
});
}
export function fetchRemote(path: string, username?: string, password?: string, prune = false, remote?: string): Promise<GitStatus> {