Skip to content

Commit

Permalink
bash: remove unnecessary conditions when checking for subcommands
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
SZEDER Gábor authored and Shawn O. Pearce committed Mar 10, 2008
1 parent a5c4f85 commit 1d17b22
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ _git_bisect ()
c=$((++c))
done

if [ $c -eq $COMP_CWORD -a -z "$command" ]; then
if [ -z "$command" ]; then
__gitcomp "start bad good reset visualize replay log"
return
fi
Expand Down Expand Up @@ -1042,7 +1042,7 @@ _git_remote ()
c=$((++c))
done

if [ $c -eq $COMP_CWORD -a -z "$command" ]; then
if [ -z "$command" ]; then
__gitcomp "add rm show prune update"
return
fi
Expand Down Expand Up @@ -1135,7 +1135,7 @@ _git_submodule ()
c=$((++c))
done

if [ $c -eq $COMP_CWORD -a -z "$command" ]; then
if [ -z "$command" ]; then
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
Expand Down Expand Up @@ -1198,7 +1198,7 @@ _git ()
c=$((++c))
done

if [ $c -eq $COMP_CWORD -a -z "$command" ]; then
if [ -z "$command" ]; then
case "${COMP_WORDS[COMP_CWORD]}" in
--*=*) COMPREPLY=() ;;
--*) __gitcomp "
Expand Down

0 comments on commit 1d17b22

Please sign in to comment.