diff options
author | Jiang Xin <zhiyou.jx@alibaba-inc.com> | 2021-01-21 03:53:31 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-01-22 22:09:06 +0100 |
commit | 822ee894f621674610a36cc9a84a9ffbbb8fb6bb (patch) | |
tree | 70c3efa9e94bacf13970a1ae8681b4a24e155615 /t/t5411/test-0020-report-ng.sh | |
parent | t5411: use different out file to prevent overwriting (diff) | |
download | git-822ee894f621674610a36cc9a84a9ffbbb8fb6bb.tar.xz git-822ee894f621674610a36cc9a84a9ffbbb8fb6bb.zip |
t5411: refactor check of refs using test_cmp_refs
Add new helper 'test_cmp_refs' to check references in a repository.
Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5411/test-0020-report-ng.sh')
-rw-r--r-- | t/t5411/test-0020-report-ng.sh | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/t/t5411/test-0020-report-ng.sh b/t/t5411/test-0020-report-ng.sh index 6618c91841..ad2c8f6535 100644 --- a/t/t5411/test-0020-report-ng.sh +++ b/t/t5411/test-0020-report-ng.sh @@ -24,12 +24,10 @@ test_expect_success "proc-receive: fail to update (ng, no message, $PROTOCOL)" ' ! [remote rejected] HEAD -> refs/for/main/topic (failed) EOF test_cmp expect actual && - git -C "$upstream" show-ref >out && - make_user_friendly_and_stable_output <out >actual && - cat >expect <<-EOF && + + test_cmp_refs -C "$upstream" <<-EOF <COMMIT-A> refs/heads/main EOF - test_cmp expect actual ' test_expect_success "setup proc-receive hook (ng message, $PROTOCOL)" ' @@ -58,10 +56,8 @@ test_expect_success "proc-receive: fail to update (ng, with message, $PROTOCOL)" ! [remote rejected] HEAD -> refs/for/main/topic (error msg) EOF test_cmp expect actual && - git -C "$upstream" show-ref >out && - make_user_friendly_and_stable_output <out >actual && - cat >expect <<-EOF && + + test_cmp_refs -C "$upstream" <<-EOF <COMMIT-A> refs/heads/main EOF - test_cmp expect actual ' |