From: Junio C Hamano Date: Wed, 9 Nov 2011 13:46:39 +0000 (-0800) Subject: Merge branch 'sn/complete-bash-wo-process-subst' X-Git-Tag: v1.7.8-rc2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/248dbbe83256202f0edd6e1468d01cfbe27fd733?hp=-c Merge branch 'sn/complete-bash-wo-process-subst' * sn/complete-bash-wo-process-subst: completion: don't leak variable from the prompt into environment --- 248dbbe83256202f0edd6e1468d01cfbe27fd733 diff --combined contrib/completion/git-completion.bash index 98af8f5c7e,32df141f91..b7c1edf1cc --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@@ -110,7 -110,7 +110,7 @@@ __git_ps1_show_upstream ( local upstream=git legacy="" verbose="" # get some config options from git-config - output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')" + local output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')" while read key value; do case "$key" in bash.showupstream) @@@ -1430,10 -1430,6 +1430,10 @@@ _git_gitk ( _gitk } +__git_match_ctag() { + awk "/^${1////\\/}/ { print \$1 }" "$2" +} + _git_grep () { __git_has_doubledash && return @@@ -1456,15 -1452,6 +1456,15 @@@ ;; esac + case "$cword,$prev" in + 2,*|*,-*) + if test -r tags; then + __gitcomp "$(__git_match_ctag "$cur" tags)" + return + fi + ;; + esac + __gitcomp "$(__git_refs)" }