Skip to content

Commit 8d8163f

Browse files
szedergitster
authored andcommitted
bash: remove dashed command leftovers
Commit 5a625b0 (bash: remove fetch, push, pull dashed form leftovers, 2008-10-03) did that already, but there were still some git-cmd left here and there. Signed-off-by: SZEDER Gábor <[email protected]> Acked-by: Shawn O. Pearce <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b21a226 commit 8d8163f

File tree

1 file changed

+8
-33
lines changed

1 file changed

+8
-33
lines changed

contrib/completion/git-completion.bash

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -650,21 +650,12 @@ _git_branch ()
650650

651651
_git_bundle ()
652652
{
653-
local mycword="$COMP_CWORD"
654-
case "${COMP_WORDS[0]}" in
655-
git)
656-
local cmd="${COMP_WORDS[2]}"
657-
mycword="$((mycword-1))"
658-
;;
659-
git-bundle*)
660-
local cmd="${COMP_WORDS[1]}"
661-
;;
662-
esac
663-
case "$mycword" in
664-
1)
653+
local cmd="${COMP_WORDS[2]}"
654+
case "$COMP_CWORD" in
655+
2)
665656
__gitcomp "create list-heads verify unbundle"
666657
;;
667-
2)
658+
3)
668659
# looking for a file
669660
;;
670661
*)
@@ -812,12 +803,7 @@ _git_fetch ()
812803
__gitcomp "$(__git_refs)" "$pfx" "${cur#*:}"
813804
;;
814805
*)
815-
local remote
816-
case "${COMP_WORDS[0]}" in
817-
git-fetch) remote="${COMP_WORDS[1]}" ;;
818-
git) remote="${COMP_WORDS[2]}" ;;
819-
esac
820-
__gitcomp "$(__git_refs2 "$remote")"
806+
__gitcomp "$(__git_refs2 "${COMP_WORDS[2]}")"
821807
;;
822808
esac
823809
fi
@@ -1060,12 +1046,7 @@ _git_pull ()
10601046
if [ "$COMP_CWORD" = 2 ]; then
10611047
__gitcomp "$(__git_remotes)"
10621048
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")"
1049+
__gitcomp "$(__git_refs "${COMP_WORDS[2]}")"
10691050
fi
10701051
}
10711052

@@ -1078,19 +1059,13 @@ _git_push ()
10781059
else
10791060
case "$cur" in
10801061
*:*)
1081-
local remote
1082-
case "${COMP_WORDS[0]}" in
1083-
git-push) remote="${COMP_WORDS[1]}" ;;
1084-
git) remote="${COMP_WORDS[2]}" ;;
1085-
esac
1086-
10871062
local pfx=""
10881063
case "$COMP_WORDBREAKS" in
10891064
*:*) : great ;;
10901065
*) pfx="${cur%%:*}:" ;;
10911066
esac
10921067

1093-
__gitcomp "$(__git_refs "$remote")" "$pfx" "${cur#*:}"
1068+
__gitcomp "$(__git_refs "${COMP_WORDS[2]}")" "$pfx" "${cur#*:}"
10941069
;;
10951070
+*)
10961071
__gitcomp "$(__git_refs)" + "${cur#+}"
@@ -1591,7 +1566,7 @@ _git_tag ()
15911566
-m|-F)
15921567
COMPREPLY=()
15931568
;;
1594-
-*|tag|git-tag)
1569+
-*|tag)
15951570
if [ $f = 1 ]; then
15961571
__gitcomp "$(__git_tags)"
15971572
else

0 commit comments

Comments
 (0)