@matheusbsbs / matheus-bagliano / commits / 8d8163f377
Fork 0

bash: remove dashed command leftovers

Commit 5a625b07 (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 <szeder@ira.uka.de> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

SZEDER Gábor committed Nov 27, 2008 at 14:35 UTC 8d8163f377829d5f61f6053bd55fdcecaf360d4c
1 file changed +8 -33
contrib/completion/git-completion.bash
+8 -33
@@ -650,21 +650,12 @@ _git_branch ()
650
651 _git_bundle ()
652 {
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)
656 __gitcomp "create list-heads verify unbundle"
657 ;;
667 - 2)
658 + 3)
659 # looking for a file
660 ;;
661 *)
@@ -812,12 +803,7 @@ _git_fetch ()
803 __gitcomp "$(__git_refs)" "$pfx" "${cur#*:}"
804 ;;
805 *)
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]}")"
807 ;;
808 esac
809 fi
@@ -1060,12 +1046,7 @@ _git_pull ()
1046 if [ "$COMP_CWORD" = 2 ]; then
1047 __gitcomp "$(__git_remotes)"
1048 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]}")"
1050 fi
1051 }
1052
@@ -1078,19 +1059,13 @@ _git_push ()
1059 else
1060 case "$cur" in
1061 *:*)
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 -
1062 local pfx=""
1063 case "$COMP_WORDBREAKS" in
1064 *:*) : great ;;
1065 *) pfx="${cur%%:*}:" ;;
1066 esac
1067
1093 - __gitcomp "$(__git_refs "$remote")" "$pfx" "${cur#*:}"
1068 + __gitcomp "$(__git_refs "${COMP_WORDS[2]}")" "$pfx" "${cur#*:}"
1069 ;;
1070 +*)
1071 __gitcomp "$(__git_refs)" + "${cur#+}"
@@ -1591,7 +1566,7 @@ _git_tag ()
1566 -m|-F)
1567 COMPREPLY=()
1568 ;;
1594 - -*|tag|git-tag)
1569 + -*|tag)
1570 if [ $f = 1 ]; then
1571 __gitcomp "$(__git_tags)"
1572 else