Skip to content

Commit

Permalink
bash: remove fetch, push, pull dashed form leftovers
Browse files Browse the repository at this point in the history
We don't provide complation for git-commands in dashed form anymore,
so there is no need to keep those cases.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Tested-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  • Loading branch information
SZEDER Gábor authored and Shawn O. Pearce committed Oct 6, 2008
1 parent 9a1fd65 commit 5a625b0
Showing 1 changed file with 9 additions and 27 deletions.
36 changes: 9 additions & 27 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -799,14 +799,9 @@ _git_fetch ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"

case "${COMP_WORDS[0]},$COMP_CWORD" in
git-fetch*,1)
if [ "$COMP_CWORD" = 2 ]; then
__gitcomp "$(__git_remotes)"
;;
git,2)
__gitcomp "$(__git_remotes)"
;;
*)
else
case "$cur" in
*:*)
local pfx=""
Expand All @@ -825,8 +820,7 @@ _git_fetch ()
__gitcomp "$(__git_refs2 "$remote")"
;;
esac
;;
esac
fi
}

_git_format_patch ()
Expand Down Expand Up @@ -1063,36 +1057,25 @@ _git_pull ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"

case "${COMP_WORDS[0]},$COMP_CWORD" in
git-pull*,1)
__gitcomp "$(__git_remotes)"
;;
git,2)
if [ "$COMP_CWORD" = 2 ]; then
__gitcomp "$(__git_remotes)"
;;
*)
else
local remote
case "${COMP_WORDS[0]}" in
git-pull) remote="${COMP_WORDS[1]}" ;;
git) remote="${COMP_WORDS[2]}" ;;
esac
__gitcomp "$(__git_refs "$remote")"
;;
esac
fi
}

_git_push ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"

case "${COMP_WORDS[0]},$COMP_CWORD" in
git-push*,1)
__gitcomp "$(__git_remotes)"
;;
git,2)
if [ "$COMP_CWORD" = 2 ]; then
__gitcomp "$(__git_remotes)"
;;
*)
else
case "$cur" in
*:*)
local remote
Expand All @@ -1116,8 +1099,7 @@ _git_push ()
__gitcomp "$(__git_refs)"
;;
esac
;;
esac
fi
}

_git_rebase ()
Expand Down

0 comments on commit 5a625b0

Please sign in to comment.