1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-09-22 10:49:02 +00:00

fix(git-state): Fix discrepancy between v0.44.0 and master (#1672)

This commit is contained in:
Tilmann Meyer 2020-09-21 21:17:06 +02:00 committed by GitHub
parent 6426bbe3e4
commit a245d54cdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -1075,7 +1075,7 @@ that information will be shown too.
| `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. |
| `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. |
| `style` | `"bold yellow"` | The style for the module. |
| `format` | `"[\\($state( $progress_current/$progress_total)\\)]($style) "` | The format for the module. |
| `format` | `"\\([$state( $progress_current/$progress_total)]($style)\\) "` | The format for the module. |
| `disabled` | `false` | Disables the `git_state` module. |
### Variables

View File

@ -27,7 +27,7 @@ impl<'a> RootModuleConfig<'a> for GitStateConfig<'a> {
am: "AM",
am_or_rebase: "AM/REBASE",
style: "bold yellow",
format: "[\\($state( $progress_current/$progress_total)\\)]($style) ",
format: "\\([$state( $progress_current/$progress_total)]($style)\\) ",
disabled: false,
}
}

View File

@ -190,7 +190,7 @@ mod tests {
let actual = ModuleRenderer::new("git_state").path(path).collect();
let expected = Some(format!("{} ", Color::Yellow.bold().paint("(REBASING 1/1)")));
let expected = Some(format!("({}) ", Color::Yellow.bold().paint("REBASING 1/1")));
assert_eq!(expected, actual);
repo_dir.close()
@ -205,7 +205,7 @@ mod tests {
let actual = ModuleRenderer::new("git_state").path(path).collect();
let expected = Some(format!("{} ", Color::Yellow.bold().paint("(MERGING)")));
let expected = Some(format!("({}) ", Color::Yellow.bold().paint("MERGING")));
assert_eq!(expected, actual);
repo_dir.close()
@ -221,8 +221,8 @@ mod tests {
let actual = ModuleRenderer::new("git_state").path(path).collect();
let expected = Some(format!(
"{} ",
Color::Yellow.bold().paint("(CHERRY-PICKING)")
"({}) ",
Color::Yellow.bold().paint("CHERRY-PICKING")
));
assert_eq!(expected, actual);
@ -238,7 +238,7 @@ mod tests {
let actual = ModuleRenderer::new("git_state").path(path).collect();
let expected = Some(format!("{} ", Color::Yellow.bold().paint("(BISECTING)")));
let expected = Some(format!("({}) ", Color::Yellow.bold().paint("BISECTING")));
assert_eq!(expected, actual);
repo_dir.close()
@ -253,7 +253,7 @@ mod tests {
let actual = ModuleRenderer::new("git_state").path(path).collect();
let expected = Some(format!("{} ", Color::Yellow.bold().paint("(REVERTING)")));
let expected = Some(format!("({}) ", Color::Yellow.bold().paint("REVERTING")));
assert_eq!(expected, actual);
repo_dir.close()