test-tool run-command: fix flip-flop init pattern
commitc90be786da950a2705152dc49b9fb771f1d0a86c
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sat, 11 Sep 2021 18:26:41 +0000 (11 20:26 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 12 Sep 2021 23:46:54 +0000 (12 16:46 -0700)
treeef5fdc8bc8ab3b429bf281d32e34f12860bab384
parent8b7c11b8668b4e774f81a9f0b4c30144b818f1d1
test-tool run-command: fix flip-flop init pattern

In be5d88e1128 (test-tool run-command: learn to run (parts of) the
testsuite, 2019-10-04) an init pattern was added that would use
TESTSUITE_INIT, but then promptly memset() everything back to 0. We'd
then set the "dup" on the two string lists.

Our setting of "next" to "-1" thus did nothing, we'd reset it to "0"
before using it. Let's set it to "0" instead, and trust the
"STRING_LIST_INIT_DUP" to set "strdup_strings" appropriately for us.

Note that while we compile this code, there's no in-tree user for the
"testsuite" target being modified here anymore, see the discussion at
and around <nycvar.QRO.7.76.6.2109091323150.59@tvgsbejvaqbjf.bet>[1].

1. https://lore.kernel.org/git/nycvar.QRO.7.76.6.2109091323150.59@tvgsbejvaqbjf.bet/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-run-command.c