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 <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Oct 12, 2022 at 23:02 UTC
a083f94c2198e10ddb0c79acccd6137c24afce5b
1 file changed
+7
-8
t/helper/test-run-command.c
+7
-8
@@ -427,18 +427,17 @@ int cmd__run_command(int argc, const char **argv)
427
strvec_clear(&proc.args);
428
strvec_pushv(&proc.args, (const char **)argv + 3);
429
430
- if (!strcmp(argv[1], "run-command-parallel"))
430
+ if (!strcmp(argv[1], "run-command-parallel")) {
431
exit(run_processes_parallel(jobs, parallel_next,
432
NULL, NULL, &proc));
433
-
434
- if (!strcmp(argv[1], "run-command-abort"))
433
+ } else if (!strcmp(argv[1], "run-command-abort")) {
434
exit(run_processes_parallel(jobs, parallel_next,
435
NULL, task_finished, &proc));
437
-
438
- if (!strcmp(argv[1], "run-command-no-jobs"))
436
+ } else if (!strcmp(argv[1], "run-command-no-jobs")) {
437
exit(run_processes_parallel(jobs, no_job,
438
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
+ }
443
}