Re: [PATCH v4 4/8] t5548: add new porcelain test cases
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jan 31, 2025, 14:46 UTC
- Message-ID
- <CAPig+cRu20put-2WM=OfJeMmDe+1_jDKPeThbC9Vsw1EmHAp3w@mail.gmail.com>
- In-Reply-To
- <20250131-pks-push-atomic-respect-exit-code-v4-4-a8b41f01a676@pks.im>
On Fri, Jan 31, 2025 at 5:53 AM Patrick Steinhardt <ps@pks.im> wrote:
Show 29 quoted lines
> Add two more test cases exercising git-push(1) with `--procelain`, one
> exercising a non-atomic and one exercising an atomic push.
>
> Based-on-patch-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> diff --git a/t/t5548-push-porcelain.sh b/t/t5548-push-porcelain.sh
> @@ -132,6 +132,40 @@ run_git_push_porcelain_output_test() {
> + # Refs of upstream : main(B) foo(A) bar(A) baz(A)
> + # Refs of workbench: main(A) baz(A) next(A)
> + # git-push : main(A) NULL (B) baz(A) next(A)
> + test_expect_success ".. git-push --porcelain ($PROTOCOL)" '
> + test_when_finished "setup_upstream \"$upstream\"" &&
> + test_must_fail git -C workbench push --porcelain origin \
> + main \
> + :refs/heads/foo \
> + $B:bar \
> + baz \
> + next >out &&
> + make_user_friendly_and_stable_output <out >actual &&
> + format_and_save_expect <<-EOF &&
> + > To <URL/of/upstream.git>
> + > = refs/heads/baz:refs/heads/baz [up to date]
> + > <COMMIT-B>:refs/heads/bar <COMMIT-A>..<COMMIT-B>
> + > - :refs/heads/foo [deleted]
> + > * refs/heads/next:refs/heads/next [new branch]
> + > ! refs/heads/main:refs/heads/main [rejected] (non-fast-forward)
> + > Done
> + EOFUsing '\EOF' rather than bare 'EOF' would be appropriate here and in the other new heredocs added by this patch.
(Not worth a reroll on its own.)