1bd72f588cb2e4950ea513aa4315ce77c792e43b
- Author
- Marc Cornellà <marc.cornella@live.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
Update to inline conditional syntax
Diff
1diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
2index 17e4d4b9def4f63a9089739cbd01f6a10e6fec0b..fa2487a2cce27c9c705de5fba7660421281f16f6 100644
3--- a/plugins/git/git.plugin.zsh
4+++ b/plugins/git/git.plugin.zsh
5@@ -33,11 +33,6 @@ function work_in_progress() {
6 fi
7 }
8
9-function _omz_git_stash_command() {
10- [[ `git --version 2>/dev/null` =~ '^git version ([[:digit:]]+.[[:digit:]]+)' && "$match[1]" >= '2.13' ]] \
11- && echo push || echo save
12-}
13-
14 #
15 # Aliases
16 # (sorted alphabetically)
17@@ -243,7 +238,12 @@ alias gsps='git show --pretty=short --show-signature'
18 alias gsr='git svn rebase'
19 alias gss='git status -s'
20 alias gst='git status'
21-alias gsta="git stash $(_omz_git_stash_command)"
22+
23+# use the default stash push on git 2.13 and newer
24+[[ "$(git --version 2>/dev/null)" =~ '^git version ([0-9]+.[0-9]+)' && "$match" -ge '2.13' ]] \
25+ && alias gsta='git stash push'
26+ || alias gsta='git stash save'
27+
28 alias gstaa='git stash apply'
29 alias gstc='git stash clear'
30 alias gstd='git stash drop'