Skip to content

Commit a083f94

Browse files
avargitster
authored andcommitted
run-command test helper: use "else if" pattern
Adjust the cmd__run_command() to use an "if/else if" chain rather than mutually exclusive "if" statements. This non-functional change makes a subsequent commit smaller. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3dcec76 commit a083f94

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

t/helper/test-run-command.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -427,18 +427,17 @@ int cmd__run_command(int argc, const char **argv)
427427
strvec_clear(&proc.args);
428428
strvec_pushv(&proc.args, (const char **)argv + 3);
429429

430-
if (!strcmp(argv[1], "run-command-parallel"))
430+
if (!strcmp(argv[1], "run-command-parallel")) {
431431
exit(run_processes_parallel(jobs, parallel_next,
432432
NULL, NULL, &proc));
433-
434-
if (!strcmp(argv[1], "run-command-abort"))
433+
} else if (!strcmp(argv[1], "run-command-abort")) {
435434
exit(run_processes_parallel(jobs, parallel_next,
436435
NULL, task_finished, &proc));
437-
438-
if (!strcmp(argv[1], "run-command-no-jobs"))
436+
} else if (!strcmp(argv[1], "run-command-no-jobs")) {
439437
exit(run_processes_parallel(jobs, no_job,
440438
NULL, task_finished, &proc));
441-
442-
fprintf(stderr, "check usage\n");
443-
return 1;
439+
} else {
440+
fprintf(stderr, "check usage\n");
441+
return 1;
442+
}
444443
}

0 commit comments

Comments
 (0)