feat(git_branch): show remote name (#1972)

* feat(git_branch): Show remote name in addition to remote branch

* feat(git_branch): Fix table indentation in config README

* feat(git_branch): Use a different method to fetch remote information

* feat(git_branch): Fix the Clippy issue regarding string constant
This commit is contained in:
Sagittarius-a
2020-12-08 11:12:53 +01:00
committed by GitHub
parent 26455df656
commit d670212a08
3 changed files with 60 additions and 32 deletions
+8 -7
View File
@@ -1031,17 +1031,18 @@ The `git_branch` module shows the active branch of the repo in your current dire
| `style` | `"bold purple"` | The style for the module. |
| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes. |
| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use `""` for no symbol. |
| `only_attached` | `false` | Only show the branch name when not in a detached HEAD state. |
| `only_attached` | `false` | Only show the branch name when not in a detached HEAD state. |
| `disabled` | `false` | Disables the `git_branch` module. |
### Variables
| Variable | Example | Description |
| -------- | -------- | ---------------------------------------------------------------------------------------------------- |
| branch | `master` | The current branch name, falls back to `HEAD` if there's no current branch (e.g. git detached HEAD). |
| remote | `master` | The remote branch name. |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
| Variable | Example | Description |
| ----------------| -------- | ---------------------------------------------------------------------------------------------------- |
| branch | `master` | The current branch name, falls back to `HEAD` if there's no current branch (e.g. git detached HEAD). |
| remote_name | `origin` | The remote name. |
| remote_branch | `master` | The name of the branch tracked on `remote_name`. |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string