summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason-S-Ross <40727264+Jason-S-Ross@users.noreply.github.com>2021-05-08 12:01:00 -0700
committerGitHub <noreply@github.com>2021-05-08 21:01:00 +0200
commit3b37bcd063f3c1b0d80e46a41a6bc9e1e933d4f7 (patch)
treeaf6b85adf2cb1ea22636a2016de4f41a63d17e51
parent45bb13047d7a0b68a2ddb5776b9140270312b6a0 (diff)
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
-rw-r--r--docs/config/README.md2
-rw-r--r--src/configs/git_commit.rs2
-rw-r--r--src/modules/git_commit.rs6
3 files changed, 5 insertions, 5 deletions
diff --git a/docs/config/README.md b/docs/config/README.md
index cec7bcbda..1f30d1258 100644
--- a/docs/config/README.md
+++ b/docs/config/README.md
@@ -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
diff --git a/src/configs/git_commit.rs b/src/configs/git_commit.rs
index 01c4c3ee3..bab6d2ae7 100644
--- a/src/configs/git_commit.rs
+++ b/src/configs/git_commit.rs
@@ -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,
}
}
diff --git a/src/modules/git_commit.rs b/src/modules/git_commit.rs
index db633ef70..864f9144d 100644
--- a/src/modules/git_commit.rs
+++ b/src/modules/git_commit.rs
@@ -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();