fix(git_commit): leading space in git commit tag (#2697)
* Move git_commit tag leading space into config Fixes #2692 * Update doc default commit tag
This commit is contained in:
parent
45bb13047d
commit
3b37bcd063
|
@ -1154,7 +1154,7 @@ The `git_commit` module shows the current commit hash and also the tag (if any)
|
|||
| `style` | `"bold green"` | The style for the module. |
|
||||
| `only_detached` | `true` | Only show git commit hash when in detached `HEAD` state |
|
||||
| `tag_disabled` | `true` | Disables showing tag info in `git_commit` module. |
|
||||
| `tag_symbol` | `"🏷 "` | Tag symbol prefixing the info shown |
|
||||
| `tag_symbol` | `" 🏷 "` | Tag symbol prefixing the info shown |
|
||||
| `disabled` | `false` | Disables the `git_commit` module. |
|
||||
|
||||
### Variables
|
||||
|
|
|
@ -23,7 +23,7 @@ impl<'a> Default for GitCommitConfig<'a> {
|
|||
style: "green bold",
|
||||
only_detached: true,
|
||||
disabled: false,
|
||||
tag_symbol: "🏷 ",
|
||||
tag_symbol: " 🏷 ",
|
||||
tag_disabled: true,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
|||
_ => None,
|
||||
})
|
||||
.map(|variable| match variable {
|
||||
"tag" => Some(Ok(format!(" {}{}", &config.tag_symbol, &tag_name))),
|
||||
"tag" => Some(Ok(format!("{}{}", &config.tag_symbol, &tag_name))),
|
||||
_ => None,
|
||||
})
|
||||
.parse(None)
|
||||
|
@ -323,7 +323,7 @@ mod tests {
|
|||
.config(toml::toml! {
|
||||
[git_commit]
|
||||
tag_disabled = false
|
||||
tag_symbol = ""
|
||||
tag_symbol = " "
|
||||
})
|
||||
.path(&repo_dir.path())
|
||||
.collect();
|
||||
|
@ -395,7 +395,7 @@ mod tests {
|
|||
[git_commit]
|
||||
only_detached = false
|
||||
tag_disabled = false
|
||||
tag_symbol = ""
|
||||
tag_symbol = " "
|
||||
})
|
||||
.path(&repo_dir.path())
|
||||
.collect();
|
||||
|
|
Loading…
Reference in New Issue