Merge branch 'ma/shortlog-revparse'
[gitweb.git] / contrib / completion / git-completion.bash
index c7957f0a90b3ccc62f0ded999c34c963f320419b..b09c8a23626b431a0cb97f6f7f930cccce25bf07 100644 (file)
@@ -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) ..."