d24196cfbdb1b1c7a7055d6dae97c4e4c3e2b4c3
- Author
- ncanceill <nicolas.canceill@ens-cachan.org>
- Committer
- ncanceill <nicolas.canceill@ens-cachan.org>
- Date
Message
git plugin: fix ggl to avoid empty string
see
https://github.com/robbyrussell/oh-my-zsh/pull/2790#issuecomment-112716330
Diff
1diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
2index 1686187605a73b2ab6cced398243a995bf630b73..cc6eb1031b1063be5639af3312713ca95fe79513 100644
3--- a/plugins/git/git.plugin.zsh
4+++ b/plugins/git/git.plugin.zsh
5@@ -101,8 +101,12 @@ git push --force origin "${b:=$1}"
6 }
7 compdef _git ggf=git-checkout
8 ggl() {
9+if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then
10+git pull origin "${*}"
11+else
12 [[ "$#" == 0 ]] && local b="$(current_branch)"
13-git pull origin "${b:=$1}" "${*[2,-1]}"
14+git pull origin "${b:=$1}"
15+fi
16 }
17 compdef _git ggl=git-checkout
18 alias ggpull='git pull origin $(current_branch)'