t5574: test porcelain output of atomic fetch
commit97d82b296332f2f4de641f4acbb5ceb4856dcba9
authorJiang Xin <zhiyou.jx@alibaba-inc.com>
Sun, 17 Dec 2023 14:11:33 +0000 (17 22:11 +0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Dec 2023 16:30:32 +0000 (18 08:30 -0800)
treec9f8d49169b9bfc3b9bf253968b4d15318d3c19b
parent813d9a91884e0afecec8ccf8e33909c405ee1d3f
t5574: test porcelain output of atomic fetch

The test case "fetch porcelain output" checks output of the fetch
command. The error output must be empty with the follow assertion:

    test_must_be_empty stderr

But this assertion fails if using atomic fetch. Refactor this test case
to use different fetch options by splitting it into three test cases.

  1. "setup for fetch porcelain output".

  2. "fetch porcelain output": for non-atomic fetch.

  3. "fetch porcelain output (atomic)": for atomic fetch.

Add new command "test_commit ..." in the first test case, so that if we
run these test cases individually (--run=4-6), "git rev-parse HEAD~"
command will work properly. Run the above test cases, we can find that
one test case has a known breakage, as shown below:

    ok 4 - setup for fetch porcelain output
    ok 5 - fetch porcelain output  # TODO known breakage vanished
    not ok 6 - fetch porcelain output (atomic) # TODO known breakage

The failed test case has an error message with only the error prompt but
no message body, as follows:

    'stderr' is not empty, it contains:
    error:

In a later commit, we will fix this issue.

Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5574-fetch-output.sh