mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 09:28:21 +00:00
fix status fetch hanging on bare repos w/o worktree (#1032)
closes #1029
This commit is contained in:
parent
0a6ca35fc7
commit
a947ce35e7
4 changed files with 13 additions and 9 deletions
1
Makefile
1
Makefile
|
|
@ -2,6 +2,7 @@
|
||||||
.PHONY: debug build-release release-linux-musl test clippy clippy-pedantic install install-debug
|
.PHONY: debug build-release release-linux-musl test clippy clippy-pedantic install install-debug
|
||||||
|
|
||||||
ARGS=-l
|
ARGS=-l
|
||||||
|
# ARGS=-l -d ~/code/git-bare-test.git
|
||||||
# ARGS=-l -d ~/code/git-bare-test.git -w ~/code/git-bare-test
|
# ARGS=-l -d ~/code/git-bare-test.git -w ~/code/git-bare-test
|
||||||
|
|
||||||
profile:
|
profile:
|
||||||
|
|
|
||||||
|
|
@ -127,23 +127,22 @@ impl AsyncStatus {
|
||||||
self.pending.fetch_add(1, Ordering::Relaxed);
|
self.pending.fetch_add(1, Ordering::Relaxed);
|
||||||
|
|
||||||
rayon_core::spawn(move || {
|
rayon_core::spawn(move || {
|
||||||
let ok = Self::fetch_helper(
|
if let Err(e) = Self::fetch_helper(
|
||||||
&repo,
|
&repo,
|
||||||
status_type,
|
status_type,
|
||||||
config,
|
config,
|
||||||
hash_request,
|
hash_request,
|
||||||
&arc_current,
|
&arc_current,
|
||||||
&arc_last,
|
&arc_last,
|
||||||
)
|
) {
|
||||||
.is_ok();
|
log::error!("fetch_helper: {}", e);
|
||||||
|
}
|
||||||
|
|
||||||
arc_pending.fetch_sub(1, Ordering::Relaxed);
|
arc_pending.fetch_sub(1, Ordering::Relaxed);
|
||||||
|
|
||||||
if ok {
|
sender
|
||||||
sender
|
.send(AsyncGitNotification::Status)
|
||||||
.send(AsyncGitNotification::Status)
|
.expect("error sending status");
|
||||||
.expect("error sending status");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok(None)
|
Ok(None)
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,10 @@ pub fn get_status(
|
||||||
|
|
||||||
let repo = repo(repo_path)?;
|
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 {
|
let show_untracked = if let Some(config) = show_untracked {
|
||||||
config
|
config
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ pub fn trim_length_left(s: &str, width: usize) -> &str {
|
||||||
//TODO: allow customize tabsize
|
//TODO: allow customize tabsize
|
||||||
pub fn tabs_to_spaces(input: String) -> String {
|
pub fn tabs_to_spaces(input: String) -> String {
|
||||||
if input.contains('\t') {
|
if input.contains('\t') {
|
||||||
input.replace("\t", " ")
|
input.replace('\t', " ")
|
||||||
} else {
|
} else {
|
||||||
input
|
input
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue