[PATCH 2/8] fetch: add a test to exercise invalid output formats
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Apr 19, 2023, 12:31 UTC
- Message-ID
- <29d2c58914b7270a4603cd65565c06ff74355e96.1681906948.git.ps@pks.im>
- In-Reply-To
- <cover.1681906948.git.ps@pks.im>
Add a testcase that exercises the logic when an invalid output format is passed via the `fetch.output` configuration.
Signed-off-by: Patrick Steinhardt <ps@pks.im> --- t/t5574-fetch-output.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/t/t5574-fetch-output.sh b/t/t5574-fetch-output.sh index f91b654d38..0e45c27007 100755 --- a/t/t5574-fetch-output.sh +++ b/t/t5574-fetch-output.sh @@ -7,6 +7,23 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh +test_expect_success 'fetch with invalid output format configuration' ' + test_when_finished "rm -rf clone" && + git clone . clone && + + test_must_fail git -C clone -c fetch.output= fetch origin >actual 2>&1 && + cat >expect <<-EOF && + fatal: invalid value for ${SQ}fetch.output${SQ}: ${SQ}${SQ} + EOF + test_cmp expect actual && + + test_must_fail git -C clone -c fetch.output=garbage fetch origin >actual 2>&1 && + cat >expect <<-EOF && + fatal: invalid value for ${SQ}fetch.output${SQ}: ${SQ}garbage${SQ} + EOF + test_cmp expect actual +' + test_expect_success 'fetch aligned output' ' git clone . full-output && test_commit looooooooooooong-tag &&
-- 2.40.0