From a25a822d0f59a09d178ac88c94c052121d92c6aa Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Fri, 17 Sep 2021 14:45:16 +0300 Subject: [PATCH] vendor: Fix ohmyzsh git plugin so it can be sourced --- .../ohmyzsh/ohmyzsh/plugins/git/git.plugin.zsh | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/vendor/github.com/ohmyzsh/ohmyzsh/plugins/git/git.plugin.zsh b/vendor/github.com/ohmyzsh/ohmyzsh/plugins/git/git.plugin.zsh index 76e0faed..64ac0a1e 100644 --- a/vendor/github.com/ohmyzsh/ohmyzsh/plugins/git/git.plugin.zsh +++ b/vendor/github.com/ohmyzsh/ohmyzsh/plugins/git/git.plugin.zsh @@ -1,7 +1,3 @@ -# Git version checking -autoload -Uz is-at-least -git_version="${${(As: :)$(git version 2>/dev/null)}[3]}" - # # Functions # @@ -20,7 +16,6 @@ function _git_log_prettily(){ git log --pretty=$1 fi } -compdef _git _git_log_prettily=git-log # Warn if the current branch is a WIP function work_in_progress() { @@ -125,10 +120,10 @@ alias gdw='git diff --word-diff' function gdnolock() { git diff "$@" ":(exclude)package-lock.json" ":(exclude)*.lock" } -compdef _git gdnolock=git-diff -function gdv() { git diff -w "$@" | view - } -compdef _git gdv=git-diff +function gdv() { + git diff -w "$@" | view - +} alias gf='git fetch' # --jobs= was added in git 2.8 @@ -146,12 +141,10 @@ function ggf() { [[ "$#" != 1 ]] && local b="$(git_current_branch)" git push --force origin "${b:=$1}" } -compdef _git ggf=git-checkout function ggfl() { [[ "$#" != 1 ]] && local b="$(git_current_branch)" git push --force-with-lease origin "${b:=$1}" } -compdef _git ggfl=git-checkout function ggl() { if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then @@ -161,7 +154,6 @@ function ggl() { git pull origin "${b:=$1}" fi } -compdef _git ggl=git-checkout function ggp() { if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then @@ -171,7 +163,6 @@ function ggp() { git push origin "${b:=$1}" fi } -compdef _git ggp=git-checkout function ggpnp() { if [[ "$#" == 0 ]]; then @@ -180,13 +171,11 @@ function ggpnp() { ggl "${*}" && ggp "${*}" fi } -compdef _git ggpnp=git-checkout function ggu() { [[ "$#" != 1 ]] && local b="$(git_current_branch)" git pull --rebase origin "${b:=$1}" } -compdef _git ggu=git-checkout alias ggpur='ggu' alias ggpull='git pull origin "$(git_current_branch)"'