Skip to content

Commit

Permalink
git: use is-at-least to test for git version
Browse files Browse the repository at this point in the history
Fixes #7754
  • Loading branch information
mcornella authored and crdant committed Dec 30, 2020
1 parent a86ca19 commit 46231fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/git/git.plugin.zsh
Expand Up @@ -241,7 +241,8 @@ alias gss='git status -s'
alias gst='git status'

# use the default stash push on git 2.13 and newer
[[ "$(git --version 2>/dev/null)" =~ '^git version ([0-9]+.[0-9]+)' && "$match" -ge '2.13' ]] \
autoload -Uz is-at-least
is-at-least 2.13 "$(git --version 2>/dev/null | awk '{print $3}')" \
&& alias gsta='git stash push' \
|| alias gsta='git stash save'

Expand Down

0 comments on commit 46231fd

Please sign in to comment.