mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-20 03:13:33 +01:00
show only local branches when autocomplete for git checkout
This commit is contained in:
parent
75b9030f48
commit
ca9f27b612
1 changed files with 8 additions and 1 deletions
|
|
@ -394,6 +394,13 @@ __git_refs_remotes ()
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# return only local branches
|
||||||
|
__git_refs_local ()
|
||||||
|
{
|
||||||
|
git for-each-ref --format='%(refname:short)' refs/heads/
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
__git_remotes ()
|
__git_remotes ()
|
||||||
{
|
{
|
||||||
local i IFS=$'\n' d="$(__gitdir)"
|
local i IFS=$'\n' d="$(__gitdir)"
|
||||||
|
|
@ -1026,7 +1033,7 @@ _git_checkout ()
|
||||||
if [ -n "$(__git_find_on_cmdline "$flags")" ]; then
|
if [ -n "$(__git_find_on_cmdline "$flags")" ]; then
|
||||||
track=''
|
track=''
|
||||||
fi
|
fi
|
||||||
__gitcomp_nl "$(__git_refs '' $track)"
|
__gitcomp_nl "$(__git_refs_local '' $track)"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue