mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
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
This commit is contained in:
commit
1dfb929a37
|
@ -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
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue