This commit is contained in:
吴杨帆 2026-05-17 18:32:07 +08:00 committed by GitHub
commit e5af0cb775
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -145,6 +145,13 @@ impl AsyncLog {
Ok(false)
}
///
pub fn invalidate(&self) {
if let Ok(mut head) = self.current_head.lock() {
*head = None;
}
}
///
pub fn fetch(&self) -> Result<FetchStatus> {
self.background.store(false, Ordering::Relaxed);
@ -176,18 +183,21 @@ impl AsyncLog {
rayon_core::spawn(move || {
scope_time!("async::revlog");
Self::fetch_helper(
if let Err(e) = Self::fetch_helper(
&repo_path,
&arc_current,
&arc_background,
&sender,
filter,
)
.expect("failed to fetch");
) {
log::error!("revlog fetch_helper: {e}");
}
arc_pending.store(false, Ordering::Relaxed);
Self::notify(&sender);
if let Err(e) = sender.send(AsyncGitNotification::Log) {
log::error!("revlog notify error: {e}");
}
});
Ok(FetchStatus::Started)