Compare commits
3
Commits
8409556158
...
c087171735
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c087171735 | ||
|
|
2d3c30b553 | ||
|
|
c8d5553214 |
+29
-15
@@ -377,14 +377,14 @@
|
|||||||
$: localBranchNames = localBranches.map((b) => b.name);
|
$: localBranchNames = localBranches.map((b) => b.name);
|
||||||
$: remoteBranches = branches.filter((b) => b.remote);
|
$: remoteBranches = branches.filter((b) => b.remote);
|
||||||
$: repoSearchTerm = repoSearch.trim().toLowerCase();
|
$: repoSearchTerm = repoSearch.trim().toLowerCase();
|
||||||
$: openRepoRows = repoTabs.filter(repoMatchesSearch);
|
$: openRepoRows = repoTabs.filter((repo) => repoMatchesSearch(repo, repoSearchTerm));
|
||||||
$: recentRepoRows = recentRepoPaths
|
$: recentRepoRows = recentRepoPaths
|
||||||
.filter((path) => !repoTabs.some((tab) => sameRepoPath(tab.path, path)))
|
.filter((path) => !repoTabs.some((tab) => sameRepoPath(tab.path, path)))
|
||||||
.map(repoRowFromPath)
|
.map((path) => repoRowFromPath(path, repoTabs, repoStatusCache))
|
||||||
.filter(repoMatchesSearch);
|
.filter((repo) => repoMatchesSearch(repo, repoSearchTerm));
|
||||||
$: favoriteRepoRows = favoriteRepoPaths
|
$: favoriteRepoRows = favoriteRepoPaths
|
||||||
.map(repoRowFromPath)
|
.map((path) => repoRowFromPath(path, repoTabs, repoStatusCache))
|
||||||
.filter(repoMatchesSearch);
|
.filter((repo) => repoMatchesSearch(repo, repoSearchTerm));
|
||||||
$: leftSidebarRows = buildLeftSidebarRows(branchPanelCollapsed, stashPanelCollapsed, explorerPanelCollapsed);
|
$: leftSidebarRows = buildLeftSidebarRows(branchPanelCollapsed, stashPanelCollapsed, explorerPanelCollapsed);
|
||||||
$: allLeftPanelsCollapsed = branchPanelCollapsed && stashPanelCollapsed && explorerPanelCollapsed;
|
$: allLeftPanelsCollapsed = branchPanelCollapsed && stashPanelCollapsed && explorerPanelCollapsed;
|
||||||
|
|
||||||
@@ -539,6 +539,7 @@
|
|||||||
try {
|
try {
|
||||||
await fetchRemote(activeRepoPath);
|
await fetchRemote(activeRepoPath);
|
||||||
applyStatus(await getStatus(activeRepoPath));
|
applyStatus(await getStatus(activeRepoPath));
|
||||||
|
await refreshRefsAndCommitGraph(activeRepoPath);
|
||||||
} catch {
|
} catch {
|
||||||
// ignore — see comment above
|
// ignore — see comment above
|
||||||
} finally {
|
} finally {
|
||||||
@@ -556,8 +557,10 @@
|
|||||||
try {
|
try {
|
||||||
await fetchRemote(path);
|
await fetchRemote(path);
|
||||||
const nextStatus = await getStatus(path);
|
const nextStatus = await getStatus(path);
|
||||||
if (sameRepoPath(path, activeRepoPath)) applyStatus(nextStatus);
|
if (sameRepoPath(path, activeRepoPath)) {
|
||||||
else updateRepoManagementStatus(path, nextStatus);
|
applyStatus(nextStatus);
|
||||||
|
await refreshRefsAndCommitGraph(path);
|
||||||
|
} else updateRepoManagementStatus(path, nextStatus);
|
||||||
} catch {
|
} catch {
|
||||||
// ignore; manual Fetch/Pull surfaces auth or network problems
|
// ignore; manual Fetch/Pull surfaces auth or network problems
|
||||||
} finally {
|
} finally {
|
||||||
@@ -949,11 +952,11 @@
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function repoRowFromPath(path: string): RepoTab {
|
function repoRowFromPath(path: string, tabs = repoTabs, statusCache = repoStatusCache): RepoTab {
|
||||||
const openTab = repoTabs.find((tab) => sameRepoPath(tab.path, path));
|
const openTab = tabs.find((tab) => sameRepoPath(tab.path, path));
|
||||||
if (openTab) return openTab;
|
if (openTab) return openTab;
|
||||||
|
|
||||||
const cached = repoStatusCache[repoKey(path)];
|
const cached = statusCache[repoKey(path)];
|
||||||
if (cached) return { ...cached, path, name: repoNameFromPath(path) };
|
if (cached) return { ...cached, path, name: repoNameFromPath(path) };
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -967,11 +970,11 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function repoMatchesSearch(repo: RepoTab): boolean {
|
function repoMatchesSearch(repo: RepoTab, searchTerm = repoSearchTerm): boolean {
|
||||||
if (!repoSearchTerm) return true;
|
if (!searchTerm) return true;
|
||||||
return repo.name.toLowerCase().includes(repoSearchTerm)
|
return repo.name.toLowerCase().includes(searchTerm)
|
||||||
|| repo.path.toLowerCase().includes(repoSearchTerm)
|
|| repo.path.toLowerCase().includes(searchTerm)
|
||||||
|| (repo.branch ?? "").toLowerCase().includes(repoSearchTerm);
|
|| (repo.branch ?? "").toLowerCase().includes(searchTerm);
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadRepoLists() {
|
function loadRepoLists() {
|
||||||
@@ -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 {
|
function isCancellationMessage(message: string): boolean {
|
||||||
return message.toLowerCase().includes("cancelled");
|
return message.toLowerCase().includes("cancelled");
|
||||||
}
|
}
|
||||||
@@ -2329,6 +2342,7 @@
|
|||||||
errorMessage = "";
|
errorMessage = "";
|
||||||
await runOperation("Fetching", async () => {
|
await runOperation("Fetching", async () => {
|
||||||
applyStatus(await fetchRemote(activeRepoPath, username, password));
|
applyStatus(await fetchRemote(activeRepoPath, username, password));
|
||||||
|
await refreshRefsAndCommitGraph(activeRepoPath);
|
||||||
trackEvent("repository_fetched", {
|
trackEvent("repository_fetched", {
|
||||||
from_stored_credential: fromStore ? 1 : 0,
|
from_stored_credential: fromStore ? 1 : 0,
|
||||||
ahead: status?.ahead ?? 0,
|
ahead: status?.ahead ?? 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user