summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-03-28 18:04:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-28 18:04:24 (GMT)
commit87cc76fa3a79eb86136e55432bd4e4ecc84744cd (patch)
treeee6f7060615a519bc5a7454e4d382b19b7ec2fed /contrib
parent90bbd502d54fe920356fa9278055dc9c9bfe9a56 (diff)
parentb60e88cc780ea54de65b62437afbeb9c857110f2 (diff)
downloadgit-87cc76fa3a79eb86136e55432bd4e4ecc84744cd.zip
git-87cc76fa3a79eb86136e55432bd4e4ecc84744cd.tar.gz
git-87cc76fa3a79eb86136e55432bd4e4ecc84744cd.tar.bz2
Merge branch 'nd/parseopt-completion'
Hotfix for recently graduated topic that give help to completion scripts from the Git subcommands that are being completed * nd/parseopt-completion: t9902: disable test on the list of merge-strategies under GETTEXT_POISON completion: clear cached --options when sourcing the completion script
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-completion.bash4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index c7957f0..b09c8a2 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -280,6 +280,10 @@ __gitcomp ()
esac
}
+# 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
+
# This function is equivalent to
#
# __gitcomp "$(git xxx --git-completion-helper) ..."