summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2020-07-11 20:18:05 +0200
committerMarc Cornellà <marc.cornella@live.com>2020-07-11 20:18:05 +0200
commit83f61949292b865a7962f1f0a4a8c0fc6350f313 (patch)
tree50beedc95f8bc05a8ddbd0e7a1643840bb1f871b /plugins
parent55a98fc06d9ea9d003683dec5aae6cb6b0130ab0 (diff)
downloadzsh-83f61949292b865a7962f1f0a4a8c0fc6350f313.tar.gz
zsh-83f61949292b865a7962f1f0a4a8c0fc6350f313.tar.bz2
zsh-83f61949292b865a7962f1f0a4a8c0fc6350f313.zip
git: change docs for git_main_branch
Also remove unnecesary dramatic remark
Diffstat (limited to 'plugins')
-rw-r--r--plugins/git/README.md14
-rw-r--r--plugins/git/git.plugin.zsh3
2 files changed, 8 insertions, 9 deletions
diff --git a/plugins/git/README.md b/plugins/git/README.md
index e809e1bcd..b92d0bf02 100644
--- a/plugins/git/README.md
+++ b/plugins/git/README.md
@@ -208,13 +208,13 @@ These are aliases that have been removed, renamed, or otherwise modified in a wa
### Current
-| Command | Description |
-|:-----------------------|:-----------------------------------------------------------------------------|
-| `grename <old> <new>` | Rename `old` branch to `new`, including in origin remote |
-| current_branch | Return the name of the current branch |
-| git_current_user_name | Returns the `user.name` config value |
-| git_current_user_email | Returns the `user.email` config value |
-| git_main_branch | Returns the name of the main branch: `master` if it exists, `main` otherwise |
+| Command | Description |
+|:-----------------------|:---------------------------------------------------------------------------------------|
+| `grename <old> <new>` | Rename `old` branch to `new`, including in origin remote |
+| current_branch | Return the name of the current branch |
+| git_current_user_name | Returns the `user.name` config value |
+| git_current_user_email | Returns the `user.email` config value |
+| git_main_branch | Returns the name of the main branch: from origin or from local branches, else 'master' |
### Work in Progress (WIP)
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index 7284cd121..8f8edcd23 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -25,8 +25,7 @@ function work_in_progress() {
fi
}
-# Get the default 'main' branch
-# Marc(2020-07-11): I hope to be able to remove this someday
+# Get the default 'main' branch: from origin, from local branches, or else just 'master'
function git_main_branch() {
# Get default branch from the origin remote
local branch