Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-06-13 22:50:45 +0300
committerJunio C Hamano <gitster@pobox.com>2018-06-13 22:50:45 +0300
commit4d605b0f38775066be0eaed33c52e0b716035498 (patch)
tree2dfd13dc49b7105ebc566e67058583ba08c8bb60 /contrib
parent8d0d53a8cf2cc0d68e396df155beba8344d7810f (diff)
parent61d48c66ea7ef8acc0dd1114e0f79f4250aead38 (diff)
Merge branch 'sg/completion-zsh-workaround'
Work around zsh segfaulting when loading git-completion.zsh * sg/completion-zsh-workaround: completion: correct zsh detection when run from git-completion.zsh
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-completion.bash5
-rw-r--r--contrib/completion/git-completion.zsh2
2 files changed, 5 insertions, 2 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 12814e9bbf..dd3e925843 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -3223,7 +3223,10 @@ __gitk_main ()
__git_complete_revlist
}
-if [[ -n ${ZSH_VERSION-} ]]; then
+if [[ -n ${ZSH_VERSION-} ]] &&
+ # Don't define these functions when sourced from 'git-completion.zsh',
+ # it has its own implementations.
+ [[ -z ${GIT_SOURCING_ZSH_COMPLETION-} ]]; then
echo "WARNING: this script is deprecated, please see git-completion.zsh" 1>&2
autoload -U +X compinit && compinit
diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
index 53cb0f934f..049d6b80f6 100644
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -39,7 +39,7 @@ if [ -z "$script" ]; then
test -f $e && script="$e" && break
done
fi
-ZSH_VERSION='' . "$script"
+GIT_SOURCING_ZSH_COMPLETION=y . "$script"
__gitcomp ()
{