From: SZEDER Gábor Date: Mon, 10 Mar 2008 15:02:22 GMT Subject: [PATCH 1/2] bash: remove unnecessary conditions when checking for subcommands Message-ID: <1205161345-21120-1-git-send-email-szeder@ira.uka.de> Checking emptyness of $command is sufficient. Signed-off-by: SZEDER Gábor --- contrib/completion/git-completion.bash | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 86b7ebe..39b2186 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -505,7 +505,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 @@ -1050,7 +1050,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 @@ -1143,7 +1143,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 --*) @@ -1206,7 +1206,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 " -- 1.5.4.4.481.g5075