From ca9f27b612032f0f80a22aa23b19a97e077e754f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B5=D0=BC=D0=B5=D0=BD=D1=82=D1=8C=D0=B5=D0=B2=20?= =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=92=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Sat, 11 Apr 2015 11:26:24 +0600 Subject: [PATCH] show only local branches when autocomplete for git checkout --- plugins/gitfast/git-completion.bash | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/gitfast/git-completion.bash b/plugins/gitfast/git-completion.bash index 5da920ecd..8fdf93f83 100644 --- a/plugins/gitfast/git-completion.bash +++ b/plugins/gitfast/git-completion.bash @@ -394,6 +394,13 @@ __git_refs_remotes () done } +# return only local branches +__git_refs_local () +{ + git for-each-ref --format='%(refname:short)' refs/heads/ + return +} + __git_remotes () { local i IFS=$'\n' d="$(__gitdir)" @@ -1026,7 +1033,7 @@ _git_checkout () if [ -n "$(__git_find_on_cmdline "$flags")" ]; then track='' fi - __gitcomp_nl "$(__git_refs '' $track)" + __gitcomp_nl "$(__git_refs_local '' $track)" ;; esac }