diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2023-03-28 16:04:26 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-03-28 07:37:53 -0700 |
commit | 1c7e239bd0bc91d6296835e30fa597b8c56e752d (patch) | |
tree | 094db4d43dedd535714f1145b25f430d04872767 /t/t7900-maintenance.sh | |
parent | f7b2ff95163247a3ec437f0ce78bb27cdac68b75 (diff) | |
download | git-1c7e239bd0bc91d6296835e30fa597b8c56e752d.tar.gz |
config API users: test for *_get_value_multi() segfaults
As we'll discuss in the subsequent commit these tests all
show *_get_value_multi() API users unable to handle there being a
value-less key in the config, which is represented with a "NULL" for
that entry in the "string" member of the returned "struct
string_list", causing a segfault.
These added tests exhaustively test for that issue, as we'll see in a
subsequent commit we'll need to change all of the API users
of *_get_value_multi(). These cases were discovered by triggering each
one individually, and then adding these tests.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7900-maintenance.sh')
-rwxr-xr-x | t/t7900-maintenance.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh index 823331e44a..d82eac6a47 100755 --- a/t/t7900-maintenance.sh +++ b/t/t7900-maintenance.sh @@ -524,6 +524,29 @@ test_expect_success 'register and unregister' ' git maintenance unregister --config-file ./other --force ' +test_expect_failure 'register with no value for maintenance.repo' ' + cp .git/config .git/config.orig && + test_when_finished mv .git/config.orig .git/config && + + cat >>.git/config <<-\EOF && + [maintenance] + repo + EOF + git maintenance register +' + +test_expect_failure 'unregister with no value for maintenance.repo' ' + cp .git/config .git/config.orig && + test_when_finished mv .git/config.orig .git/config && + + cat >>.git/config <<-\EOF && + [maintenance] + repo + EOF + git maintenance unregister && + git maintenance unregister --force +' + test_expect_success !MINGW 'register and unregister with regex metacharacters' ' META="a+b*c" && git init "$META" && |