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
+53 -54
View File
@@ -53,7 +53,7 @@
);
const versionLabel = $derived(
version && currentVersion
? `${currentVersion} -> ${version}`
? `${currentVersion} ${version}`
: version
? `Version ${version}`
: "New version",
@@ -69,34 +69,32 @@
role={state === "error" ? "alert" : "status"}
aria-live={state === "error" ? "assertive" : "polite"}
>
<div class="update-toast-glow" aria-hidden="true"></div>
<div class="update-toast-icon" class:busy={isBusy}>
{#if state === "downloading"}
<LoaderCircle class="spin" size={21} aria-hidden="true" />
{:else if state === "installed"}
<PackageCheck size={21} aria-hidden="true" />
{:else if state === "error"}
<AlertCircle size={21} aria-hidden="true" />
{:else}
<Sparkles size={21} aria-hidden="true" />
{/if}
</div>
<div class="update-toast-content">
<div class="update-toast-top">
<div class="update-toast-copy">
<span class="update-toast-kicker">{versionLabel}</span>
<h2>{title}</h2>
</div>
{#if !isBusy}
<button class="update-toast-close" type="button" onclick={onDismiss} title="Close" aria-label="Close">
<X size={15} aria-hidden="true" />
</button>
<header class="update-toast-header">
<div class="update-toast-icon" class:busy={isBusy}>
{#if state === "downloading"}
<LoaderCircle class="spin" size={18} aria-hidden="true" />
{:else if state === "installed"}
<PackageCheck size={18} aria-hidden="true" />
{:else if state === "error"}
<AlertCircle size={18} aria-hidden="true" />
{:else}
<Sparkles size={18} aria-hidden="true" />
{/if}
</div>
<div class="update-toast-copy">
<span class="update-toast-kicker">Gitty update · {versionLabel}</span>
<h2>{title}</h2>
</div>
{#if !isBusy}
<button class="update-toast-close" type="button" onclick={onDismiss} title="Close" aria-label="Close">
<X size={15} aria-hidden="true" />
</button>
{/if}
</header>
<div class="update-toast-body">
<p>{description}</p>
{#if showProgress}
@@ -115,33 +113,34 @@
</div>
{/if}
<div class="update-toast-actions">
{#if state === "installed"}
<button class="update-toast-secondary" type="button" onclick={onDismiss}>
Got it
</button>
{:else if state === "error"}
<button class="update-toast-secondary" type="button" onclick={onDismiss}>
Close
</button>
<button class="update-toast-primary" type="button" onclick={onInstall}>
<Download size={14} aria-hidden="true" />
Try again
</button>
{:else}
<button class="update-toast-secondary" type="button" onclick={onLater} disabled={isBusy}>
Later
</button>
<button class="update-toast-primary" type="button" onclick={onInstall} disabled={isBusy}>
{#if isBusy}
<LoaderCircle class="spin" size={14} aria-hidden="true" />
Installing
{:else}
<Download size={14} aria-hidden="true" />
Install
{/if}
</button>
{/if}
</div>
</div>
<footer class="update-toast-actions">
{#if state === "installed"}
<button class="update-toast-secondary" type="button" onclick={onDismiss}>
Got it
</button>
{:else if state === "error"}
<button class="update-toast-secondary" type="button" onclick={onDismiss}>
Close
</button>
<button class="update-toast-primary" type="button" onclick={onInstall}>
<Download size={14} aria-hidden="true" />
Try again
</button>
{:else}
<button class="update-toast-secondary" type="button" onclick={onLater} disabled={isBusy}>
Later
</button>
<button class="update-toast-primary" type="button" onclick={onInstall} disabled={isBusy}>
{#if isBusy}
<LoaderCircle class="spin" size={14} aria-hidden="true" />
Installing
{:else}
<Download size={14} aria-hidden="true" />
Install
{/if}
</button>
{/if}
</footer>
</section>