]> Kevux Git Server - rit/commit
git rev-parse --parseopt tests: add more usagestr tests
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 13 Sep 2021 00:13:21 +0000 (02:13 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Sep 2021 01:57:30 +0000 (18:57 -0700)
commit84122ecdbfdf5a52153a34b53fad60a5f50e6b13
treeabb304ebc938dbf39dab9d8ef8ced4857045ea6e
parent78a509190dcac5a3f9971b35c1962c1eeee6af27
git rev-parse --parseopt tests: add more usagestr tests

Add tests for the "usagestr" passed to parse-options.c
usage_with_options_internal() through cmd_parseopt().

These test for edge cases in the existing behavior related to the
"--parseopt" interface doing its own line-splitting with
strbuf_getline(), and the native C interface expecting and potentially
needing to handle newlines within the strings in the array it
accepts. The results are probably something that wasn't anticipated,
but let's make sure we stay backwards compatible with it.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1502-rev-parse-parseopt.sh