From 2d3c30b553299d66a8b046f574ca55ab8b190736 Mon Sep 17 00:00:00 2001 From: Christoph Brandau Date: Thu, 9 Jul 2026 09:21:33 +0200 Subject: [PATCH] feat(App): enhance repository fetching with reference and commit updates This update improves the repository fetching process by ensuring that the references and commit graph are refreshed after fetching remote repositories. This change enhances the accuracy of the displayed repository state and ensures that users have the most up-to-date information. - Added a new function to refresh refs and commit history - Integrated the refresh function into the fetching workflow - Improved status application logic for active repositories --- src/App.svelte | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index f086c45..32c6b59 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -539,6 +539,7 @@ try { await fetchRemote(activeRepoPath); applyStatus(await getStatus(activeRepoPath)); + await refreshRefsAndCommitGraph(activeRepoPath); } catch { // ignore — see comment above } finally { @@ -556,8 +557,10 @@ try { await fetchRemote(path); const nextStatus = await getStatus(path); - if (sameRepoPath(path, activeRepoPath)) applyStatus(nextStatus); - else updateRepoManagementStatus(path, nextStatus); + if (sameRepoPath(path, activeRepoPath)) { + applyStatus(nextStatus); + await refreshRefsAndCommitGraph(path); + } else updateRepoManagementStatus(path, nextStatus); } catch { // ignore; manual Fetch/Pull surfaces auth or network problems } finally { @@ -1629,6 +1632,16 @@ } } + async function refreshRefsAndCommitGraph(path = activeRepoPath) { + const previousHeadHash = lastFileHistoryHeadHash; + await refreshBranchList(path); + await refreshTags(path); + await refreshCommitHistory(path); + if (lastFileHistoryHeadHash !== previousHeadHash) { + await refreshFileHistory(path); + } + } + function isCancellationMessage(message: string): boolean { return message.toLowerCase().includes("cancelled"); } @@ -2329,6 +2342,7 @@ errorMessage = ""; await runOperation("Fetching", async () => { applyStatus(await fetchRemote(activeRepoPath, username, password)); + await refreshRefsAndCommitGraph(activeRepoPath); trackEvent("repository_fetched", { from_stored_credential: fromStore ? 1 : 0, ahead: status?.ahead ?? 0,