refactor git cache

This commit is contained in:
2026-09-13 21:13:13 +07:00
parent 2414095725
commit 1e19fb6b17
9 changed files with 44 additions and 40 deletions
@@ -26,7 +26,7 @@ use signed_core::{
merge_base_of, pull_request_patch,
};
use signed_git::{FileCommit, patch_commits, patch_diffs};
use signed_state::{Backend, GitStore, ProfileStore, RepoStore};
use signed_state::{Backend, ProfileStore, RepoStore, git_cache};
use signed_ui::{CountBadge, UserAvatar, placeholder, status_badge};
use utils::{relative_time, relative_time_secs};
@@ -217,7 +217,7 @@ impl PullRequestDetailView {
self.current_commit = binding.tip.clone().map(SharedString::from);
cx.notify();
let cache = GitStore::global(cx).cache().clone();
let cache = git_cache();
self.load_generation = self.load_generation.wrapping_add(1);
let generation = self.load_generation;
@@ -26,7 +26,7 @@ use signed_git::{
delete_refs_with_prefix, fetch_repo_refs, fork_namespace, merge_base, refs_with_prefix,
worktree_commit_range_commits, worktree_commit_range_diff,
};
use signed_state::{Backend, CheckoutsStore, GitStore, RepoListStore, RepoStore};
use signed_state::{Backend, CheckoutsStore, RepoListStore, RepoStore, git_cache};
use signed_ui::{CountBadge, placeholder, ref_selector_trigger};
use crate::views::commit_diff::{COMMIT_ROW_HEIGHT, CommitDiffView, DiffPane, commit_row};
@@ -533,7 +533,7 @@ impl NewPullRequestView {
let Some((base, _euc)) = self.base_repo(cx) else {
return;
};
let cache = GitStore::global(cx).cache().clone();
let cache = git_cache();
let mirror_path = cache.repo_path(&base);
let namespace = fork_namespace(&announcement);
let clone_urls = announcement.clone.clone();
+3 -3
View File
@@ -26,8 +26,8 @@ use nostr::prelude::{RelayUrl, ToBech32, Url};
use signed_core::{Announcement, RepoAddr, RepoStatus};
use signed_git::FileCommit;
use signed_state::{
Backend, CheckoutStatus, CheckoutsStore, GitStore, LocalReposStore, ProfileStore,
RepoListStore, RepoStore, pr_proposes_checkout,
Backend, CheckoutStatus, CheckoutsStore, LocalReposStore, ProfileStore, RepoListStore,
RepoStore, git_cache, pr_proposes_checkout,
};
use signed_ui::{
CountBadge, DropdownButton, PixelAvatar, UserAvatar, copy_row, menu_copy_row, middle_truncate,
@@ -343,7 +343,7 @@ impl RepoDetailView {
self.repo_started = true;
let cache = GitStore::global(cx).cache().clone();
let cache = git_cache();
let addr = announcement.addr();
let clone_urls: Vec<Url> = announcement.clone.clone();