bash: remove unnecessary conditions when checking for subcommands
Checking emptyness of $command is sufficient. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
SZEDER Gábor committed
Mar 10, 2008 at 16:02 UTC
1d17b22ebf9d894cef393e3e062f383aad8817e8
1 file changed
+4
-4
contrib/completion/git-completion.bash
+4
-4
@@ -497,7 +497,7 @@ _git_bisect ()
497
c=$((++c))
498
done
499
500
- if [ $c -eq $COMP_CWORD -a -z "$command" ]; then
500
+ if [ -z "$command" ]; then
501
__gitcomp "start bad good reset visualize replay log"
502
return
503
fi
@@ -1042,7 +1042,7 @@ _git_remote ()
1042
c=$((++c))
1043
done
1044
1045
- if [ $c -eq $COMP_CWORD -a -z "$command" ]; then
1045
+ if [ -z "$command" ]; then
1046
__gitcomp "add rm show prune update"
1047
return
1048
fi
@@ -1135,7 +1135,7 @@ _git_submodule ()
1135
c=$((++c))
1136
done
1137
1138
- if [ $c -eq $COMP_CWORD -a -z "$command" ]; then
1138
+ if [ -z "$command" ]; then
1139
local cur="${COMP_WORDS[COMP_CWORD]}"
1140
case "$cur" in
1141
--*)
@@ -1198,7 +1198,7 @@ _git ()
1198
c=$((++c))
1199
done
1200
1201
- if [ $c -eq $COMP_CWORD -a -z "$command" ]; then
1201
+ if [ -z "$command" ]; then
1202
case "${COMP_WORDS[COMP_CWORD]}" in
1203
--*=*) COMPREPLY=() ;;
1204
--*) __gitcomp "