diff mbox series

[01/27] lib-bash.sh: move `then` onto its own line

Message ID b4442fb408c80cf6c4d8fd05b474c0094e243126.1573779465.git.liu.denton@gmail.com (mailing list archive)
State New, archived
Headers show
Series t: general test cleanup + `set -o pipefail` | expand

Commit Message

Denton Liu Nov. 15, 2019, 1 a.m. UTC
The code style for tests is to have statements on their own line if
possible. Move the `then` onto its own line so that it conforms with the
test style.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 t/lib-bash.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Eric Sunshine Nov. 15, 2019, 6:22 p.m. UTC | #1
On Thu, Nov 14, 2019 at 8:00 PM Denton Liu <liu.denton@gmail.com> wrote:
> The code style for tests is to have statements on their own line if
> possible. Move the `then` onto its own line so that it conforms with the
> test style.
>
> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
> diff --git a/t/lib-bash.sh b/t/lib-bash.sh
> @@ -2,7 +2,8 @@
> -if test -n "$BASH" && test -z "$POSIXLY_CORRECT"; then
> +if test -n "$BASH" && test -z "$POSIXLY_CORRECT"
> +then

Okay...

>         # we are in full-on bash mode
>         true
>  elif type bash >/dev/null 2>&1; then

... but why not move this 'then' to its own line, as well?
Junio C Hamano Nov. 16, 2019, 2:50 a.m. UTC | #2
Eric Sunshine <sunshine@sunshineco.com> writes:

> On Thu, Nov 14, 2019 at 8:00 PM Denton Liu <liu.denton@gmail.com> wrote:
>> The code style for tests is to have statements on their own line if
>> possible. Move the `then` onto its own line so that it conforms with the
>> test style.
>>
>> Signed-off-by: Denton Liu <liu.denton@gmail.com>
>> ---
>> diff --git a/t/lib-bash.sh b/t/lib-bash.sh
>> @@ -2,7 +2,8 @@
>> -if test -n "$BASH" && test -z "$POSIXLY_CORRECT"; then
>> +if test -n "$BASH" && test -z "$POSIXLY_CORRECT"
>> +then
>
> Okay...
>
>>         # we are in full-on bash mode
>>         true
>>  elif type bash >/dev/null 2>&1; then
>
> ... but why not move this 'then' to its own line, as well?

Good eyes ;-)
diff mbox series

Patch

diff --git a/t/lib-bash.sh b/t/lib-bash.sh
index 2be955fafb..6a2c21cd24 100644
--- a/t/lib-bash.sh
+++ b/t/lib-bash.sh
@@ -2,7 +2,8 @@ 
 # to run under Bash; primarily intended for tests of the completion
 # script.
 
-if test -n "$BASH" && test -z "$POSIXLY_CORRECT"; then
+if test -n "$BASH" && test -z "$POSIXLY_CORRECT"
+then
 	# we are in full-on bash mode
 	true
 elif type bash >/dev/null 2>&1; then