From aed3881359027921afffae2c6da853034a42c64d Mon Sep 17 00:00:00 2001 From: SZEDER Gábor Date: Thu, 23 Mar 2017 16:29:15 +0100 Subject: completion: support excluding full refs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 49416ad22 (completion: support excluding refs, 2016-08-24) made possible to complete short refs with a '^' prefix. Extend the support to full refs to make completing '^refs/...' work. Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'contrib/completion/git-completion.bash') diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 067dff823d..882635f97a 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -387,6 +387,10 @@ __git_refs () fi if [ "$list_refs_from" = path ]; then + if [[ "$cur_" == ^* ]]; then + pfx="^" + cur_=${cur_#^} + fi case "$cur_" in refs|refs/*) format="refname" @@ -394,10 +398,6 @@ __git_refs () track="" ;; *) - if [[ "$cur_" == ^* ]]; then - pfx="^" - cur_=${cur_#^} - fi for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do if [ -e "$dir/$i" ]; then echo $pfx$i; fi done -- cgit v1.3