git-completion.bash: separate some commands onto their own line

In e94fb44042 (git-completion.bash: pass $__git_subcommand_idx from __git_main(), 2021-03-24), a line was introduced which contained multiple statements. This is difficult to read so break it into multiple lines. While we're at it, follow this convention for the rest of the __git_main() and break up lines that contain multiple statements. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Denton Liu committed Apr 20, 2021 at 02:19 UTC 8c8c8c0e1655aed8027fa04bb1998bb0301fb075
1 file changed +28 -9
contrib/completion/git-completion.bash
+28 -9
@@ -3400,17 +3400,35 @@ __git_main ()
3400 while [ $c -lt $cword ]; do
3401 i="${words[c]}"
3402 case "$i" in
3403 - --git-dir=*) __git_dir="${i#--git-dir=}" ;;
3404 - --git-dir) ((c++)) ; __git_dir="${words[c]}" ;;
3405 - --bare) __git_dir="." ;;
3406 - --help) command="help"; break ;;
3407 - -c|--work-tree|--namespace) ((c++)) ;;
3408 - -C) __git_C_args[C_args_count++]=-C
3403 + --git-dir=*)
3404 + __git_dir="${i#--git-dir=}"
3405 + ;;
3406 + --git-dir)
3407 + ((c++))
3408 + __git_dir="${words[c]}"
3409 + ;;
3410 + --bare)
3411 + __git_dir="."
3412 + ;;
3413 + --help)
3414 + command="help"
3415 + break
3416 + ;;
3417 + -c|--work-tree|--namespace)
3418 + ((c++))
3419 + ;;
3420 + -C)
3421 + __git_C_args[C_args_count++]=-C
3422 ((c++))
3423 __git_C_args[C_args_count++]="${words[c]}"
3424 ;;
3412 - -*) ;;
3413 - *) command="$i"; __git_subcommand_idx="$c"; break ;;
3425 + -*)
3426 + ;;
3427 + *)
3428 + command="$i"
3429 + __git_subcommand_idx="$c"
3430 + break
3431 + ;;
3432 esac
3433 ((c++))
3434 done
@@ -3432,7 +3450,8 @@ __git_main ()
3450 ;;
3451 esac
3452 case "$cur" in
3435 - --*) __gitcomp "
3453 + --*)
3454 + __gitcomp "
3455 --paginate
3456 --no-pager
3457 --git-dir=