mirror of
https://github.com/gitui-org/gitui.git
synced 2026-10-12 02:14:16 +00:00
fix status fetch hanging on bare repos w/o worktree (#1032)
closes #1029
This commit is contained in:
@@ -127,23 +127,22 @@ impl AsyncStatus {
|
||||
self.pending.fetch_add(1, Ordering::Relaxed);
|
||||
|
||||
rayon_core::spawn(move || {
|
||||
let ok = Self::fetch_helper(
|
||||
if let Err(e) = Self::fetch_helper(
|
||||
&repo,
|
||||
status_type,
|
||||
config,
|
||||
hash_request,
|
||||
&arc_current,
|
||||
&arc_last,
|
||||
)
|
||||
.is_ok();
|
||||
) {
|
||||
log::error!("fetch_helper: {}", e);
|
||||
}
|
||||
|
||||
arc_pending.fetch_sub(1, Ordering::Relaxed);
|
||||
|
||||
if ok {
|
||||
sender
|
||||
.send(AsyncGitNotification::Status)
|
||||
.expect("error sending status");
|
||||
}
|
||||
sender
|
||||
.send(AsyncGitNotification::Status)
|
||||
.expect("error sending status");
|
||||
});
|
||||
|
||||
Ok(None)
|
||||
|
||||
@@ -104,6 +104,10 @@ pub fn get_status(
|
||||
|
||||
let repo = repo(repo_path)?;
|
||||
|
||||
if repo.is_bare() && !repo.is_worktree() {
|
||||
return Ok(Vec::new());
|
||||
}
|
||||
|
||||
let show_untracked = if let Some(config) = show_untracked {
|
||||
config
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user