summaryrefslogtreecommitdiff
path: root/t/t5411/test-0000-standard-git-push.sh
diff options
context:
space:
mode:
authorJiang Xin <worldhello.net@gmail.com>2021-06-17 03:17:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-06-17 05:12:24 (GMT)
commit12d6991cf417465d567c38ba8ae7d59bda7a202f (patch)
tree9474d49f346d2db497f1bc2b95dacaf61b69128a /t/t5411/test-0000-standard-git-push.sh
parent3c06a583398f6630c7162b463ff1acbdf0110f83 (diff)
downloadgit-12d6991cf417465d567c38ba8ae7d59bda7a202f.zip
git-12d6991cf417465d567c38ba8ae7d59bda7a202f.tar.gz
git-12d6991cf417465d567c38ba8ae7d59bda7a202f.tar.bz2
test: refactor to use "get_abbrev_oid" to get abbrev oid
Add new function "get_abbrev_oid" to get abbrev object ID. This function has a default value which helps to prepare a nonempty replace pattern for sed command. An empty replace pattern may cause sed fail to allocate memory. Refactor function "make_user_friendly_and_stable_output" to use "get_abbrev_oid" to get abbrev object ID. 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-0000-standard-git-push.sh')
-rw-r--r--t/t5411/test-0000-standard-git-push.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t5411/test-0000-standard-git-push.sh b/t/t5411/test-0000-standard-git-push.sh
index d8aafc2..ce64bb6 100644
--- a/t/t5411/test-0000-standard-git-push.sh
+++ b/t/t5411/test-0000-standard-git-push.sh
@@ -15,7 +15,7 @@ test_expect_success "git-push ($PROTOCOL)" '
> remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z
> remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z
> To <URL/of/upstream.git>
- > <OID-A>..<OID-B> <COMMIT-B> -> main
+ > <COMMIT-A>..<COMMIT-B> <COMMIT-B> -> main
> * [new branch] HEAD -> next
EOF
test_cmp expect actual &&
@@ -69,7 +69,7 @@ test_expect_success "non-fast-forward git-push ($PROTOCOL)" '
> remote: # post-receive hook Z
> remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/next Z
> To <URL/of/upstream.git>
- > <OID-A>..<OID-B> <COMMIT-B> -> next
+ > <COMMIT-A>..<COMMIT-B> <COMMIT-B> -> next
> ! [rejected] main -> main (non-fast-forward)
EOF
test_cmp expect actual &&
@@ -106,7 +106,7 @@ test_expect_success "git-push -f ($PROTOCOL)" '
> remote: post-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic Z
> remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c Z
> To <URL/of/upstream.git>
- > + <OID-B>...<OID-A> main -> main (forced update)
+ > + <COMMIT-B>...<COMMIT-A> main -> main (forced update)
> - [deleted] next
> * [new tag] v123 -> v123
> * [new reference] main -> refs/review/main/topic