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-05-08 09:59:25 +0300
committerJunio C Hamano <gitster@pobox.com>2018-05-08 09:59:25 +0300
commit1dfb929a37bcb1456832753ec073a3fb5a27ffd0 (patch)
treead8e146f967c358eba518256fdf69b8285dcf7f6 /contrib
parent90186fa0579e4dcdde08a2d823d9b269578d5a70 (diff)
parent94408dc71c0410a385193171cc79d230920b85fa (diff)
Merge branch 'sg/completion-clear-cached'
The completion script (in contrib/) learned to clear cached list of command line options upon dot-sourcing it again in a more efficient way. * sg/completion-clear-cached: completion: reduce overhead of clearing cached --options
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-completion.bash6
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 86a13fca28..159e6407df 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -284,7 +284,11 @@ __gitcomp ()
# Clear the variables caching builtins' options when (re-)sourcing
# the completion script.
-unset $(set |sed -ne 's/^\(__gitcomp_builtin_[a-zA-Z0-9_][a-zA-Z0-9_]*\)=.*/\1/p') 2>/dev/null
+if [[ -n ${ZSH_VERSION-} ]]; then
+ unset $(set |sed -ne 's/^\(__gitcomp_builtin_[a-zA-Z0-9_][a-zA-Z0-9_]*\)=.*/\1/p') 2>/dev/null
+else
+ unset $(compgen -v __gitcomp_builtin_)
+fi
# This function is equivalent to
#