fix(git_state): remove unwrap in `describe_rebase` (#1761)
This commit is contained in:
parent
a73d7140eb
commit
205fd1abdd
|
@ -135,18 +135,17 @@ fn describe_rebase<'a>(root: &'a PathBuf, rebase_config: &'a str) -> StateDescri
|
||||||
|
|
||||||
let progress = if has_path("rebase-merge/msgnum") {
|
let progress = if has_path("rebase-merge/msgnum") {
|
||||||
paths_to_progress("rebase-merge/msgnum", "rebase-merge/end")
|
paths_to_progress("rebase-merge/msgnum", "rebase-merge/end")
|
||||||
} else if has_path("rebase-merge/onto") {
|
|
||||||
Some((1, 1))
|
|
||||||
} else if has_path("rebase-apply") {
|
} else if has_path("rebase-apply") {
|
||||||
paths_to_progress("rebase-apply/next", "rebase-apply/last")
|
paths_to_progress("rebase-apply/next", "rebase-apply/last")
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
let progress = progress.unwrap_or((1, 1));
|
||||||
|
|
||||||
StateDescription {
|
StateDescription {
|
||||||
label: rebase_config,
|
label: rebase_config,
|
||||||
current: Some(format!("{}", progress.unwrap().0)),
|
current: Some(format!("{}", progress.0)),
|
||||||
total: Some(format!("{}", progress.unwrap().1)),
|
total: Some(format!("{}", progress.1)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue