1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-25 15:20:08 +00:00

git: use is-at-least to test for git version

Fixes #7754
This commit is contained in:
Marc Cornellà 2019-04-10 11:47:29 +02:00 committed by GitHub
parent 8d7ce18e12
commit 7824dc637d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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'