Properly report status on worktree repos
This commit is contained in:
@@ -790,11 +790,7 @@ impl Repo {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let changes = match is_worktree {
|
let changes = match is_worktree {
|
||||||
true => {
|
true => None,
|
||||||
return Err(String::from(
|
|
||||||
"Cannot get changes as this is a bare worktree repository",
|
|
||||||
))
|
|
||||||
}
|
|
||||||
false => {
|
false => {
|
||||||
let statuses = self
|
let statuses = self
|
||||||
.0
|
.0
|
||||||
|
|||||||
@@ -30,7 +30,9 @@ fn add_repo_status(
|
|||||||
true => "\u{2714}",
|
true => "\u{2714}",
|
||||||
false => "",
|
false => "",
|
||||||
},
|
},
|
||||||
&match repo_status.changes {
|
&match is_worktree {
|
||||||
|
true => String::from(""),
|
||||||
|
false => match repo_status.changes {
|
||||||
Some(changes) => {
|
Some(changes) => {
|
||||||
let mut out = Vec::new();
|
let mut out = Vec::new();
|
||||||
if changes.files_new > 0 {
|
if changes.files_new > 0 {
|
||||||
@@ -46,6 +48,7 @@ fn add_repo_status(
|
|||||||
}
|
}
|
||||||
None => String::from("\u{2714}"),
|
None => String::from("\u{2714}"),
|
||||||
},
|
},
|
||||||
|
},
|
||||||
repo_status
|
repo_status
|
||||||
.branches
|
.branches
|
||||||
.iter()
|
.iter()
|
||||||
|
|||||||
Reference in New Issue
Block a user