Skip to content

Commit

Permalink
hack up remote and refspec completion for top-level aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Feb 21, 2011
1 parent 43bfe1e commit 20eb6f2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,17 @@ __git_complete_revlist ()

__git_complete_remote_or_refspec ()
{
local cmd="${COMP_WORDS[1]}"
local cmd="${COMP_WORDS[0]}"
local cur="${COMP_WORDS[COMP_CWORD]}"
local i c=2 remote="" pfx="" lhs=1 no_complete_refspec=0
local i c=1 remote="" pfx="" lhs=1 no_complete_refspec=0

# git-sh hack: adjust args upward when completing git *
if [ "$cmd" = "git" ]
then
cmd="${COMP_WORDS[1]}"
c=2
fi

while [ $c -lt $COMP_CWORD ]; do
i="${COMP_WORDS[c]}"
case "$i" in
Expand Down

0 comments on commit 20eb6f2

Please sign in to comment.