bash: remove fetch, push, pull dashed form leftovers
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>
SZEDER Gábor committed
Oct 3, 2008 at 21:34 UTC
5a625b07bbff709037f26be1c393337b6d9e103f
1 file changed
+9
-27
contrib/completion/git-completion.bash
+9
-27
@@ -799,14 +799,9 @@ _git_fetch ()
799
{
800
local cur="${COMP_WORDS[COMP_CWORD]}"
801
802
- case "${COMP_WORDS[0]},$COMP_CWORD" in
803
- git-fetch*,1)
802
+ if [ "$COMP_CWORD" = 2 ]; then
803
__gitcomp "$(__git_remotes)"
805
- ;;
806
- git,2)
807
- __gitcomp "$(__git_remotes)"
808
- ;;
809
- *)
804
+ else
805
case "$cur" in
806
*:*)
807
local pfx=""
@@ -825,8 +820,7 @@ _git_fetch ()
820
__gitcomp "$(__git_refs2 "$remote")"
821
;;
822
esac
828
- ;;
829
- esac
823
+ fi
824
}
825
826
_git_format_patch ()
@@ -1063,36 +1057,25 @@ _git_pull ()
1057
{
1058
local cur="${COMP_WORDS[COMP_CWORD]}"
1059
1066
- case "${COMP_WORDS[0]},$COMP_CWORD" in
1067
- git-pull*,1)
1068
- __gitcomp "$(__git_remotes)"
1069
- ;;
1070
- git,2)
1060
+ if [ "$COMP_CWORD" = 2 ]; then
1061
__gitcomp "$(__git_remotes)"
1072
- ;;
1073
- *)
1062
+ else
1063
local remote
1064
case "${COMP_WORDS[0]}" in
1065
git-pull) remote="${COMP_WORDS[1]}" ;;
1066
git) remote="${COMP_WORDS[2]}" ;;
1067
esac
1068
__gitcomp "$(__git_refs "$remote")"
1080
- ;;
1081
- esac
1069
+ fi
1070
}
1071
1072
_git_push ()
1073
{
1074
local cur="${COMP_WORDS[COMP_CWORD]}"
1075
1088
- case "${COMP_WORDS[0]},$COMP_CWORD" in
1089
- git-push*,1)
1090
- __gitcomp "$(__git_remotes)"
1091
- ;;
1092
- git,2)
1076
+ if [ "$COMP_CWORD" = 2 ]; then
1077
__gitcomp "$(__git_remotes)"
1094
- ;;
1095
- *)
1078
+ else
1079
case "$cur" in
1080
*:*)
1081
local remote
@@ -1116,8 +1099,7 @@ _git_push ()
1099
__gitcomp "$(__git_refs)"
1100
;;
1101
esac
1119
- ;;
1120
- esac
1102
+ fi
1103
}
1104
1105
_git_rebase ()