summaryrefslogtreecommitdiff
path: root/t/t5411/common-functions.sh
AgeCommit message (Collapse)AuthorFilesLines
2021-06-17test: refactor to use "get_abbrev_oid" to get abbrev oidLibravatar Jiang Xin1-5/+15
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>
2021-06-17test: refactor to use "test_commit" to create commitsLibravatar Jiang Xin1-19/+6
Refactor function "create_commits_in" to use "test_commit" to create commit. Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-06-17test: compare raw output, not mangle tabs and spacesLibravatar Jiang Xin1-4/+5
Before comparing with the expect file, we used to call function "make_user_friendly_and_stable_output" to filter out trailing spaces in output. Ævar recommends using pattern "s/Z$//" to prepare expect file, and then compare it with raw output. Since we have fixed the issue of occasionally missing the clear-to-eol suffix when displaying sideband #2 messages, it is safe and stable to test against raw output. Suggested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-02-17Merge branch 'jx/t5411-unique-filenames'Libravatar Junio C Hamano1-0/+15
Avoid individual tests in t5411 from getting affected by each other by forcing them to use separate output files during the test. * jx/t5411-unique-filenames: t5411: refactor check of refs using test_cmp_refs t5411: use different out file to prevent overwriting
2021-01-22t5411: refactor check of refs using test_cmp_refsLibravatar Jiang Xin1-0/+15
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>
2021-01-21tests: remove uses of GIT_TEST_GETTEXT_POISON=falseLibravatar Ævar Arnfjörð Bjarmason1-3/+2
As noted in previous commits we are removing the use of GIT_TEST_GETTEXT_POISON=false. These tests all relied on the facility being off, it always is off after an earlier change, but we hadn't removed the redundant assignments to "false" in the tests. I'm preserving the deletion of "error" lines in 38b9197a76a (t5411: add basic test cases for proc-receive hook, 2020-08-27), it turns out that's useful even without GIT_TEST_GETTEXT_POISON=true in play. Update a comment added in that commit to note that. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-11t5411: new helper filter_out_user_friendly_and_stable_outputLibravatar Jiang Xin1-1/+6
New helper `filter_out_user_friendly_and_stable_output` will call common helpr function `make_user_friendly_and_stable_output` and use additional arguments to filter out messages for specific test cases. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-31t5411: adjust the remaining support files for init.defaultBranch=mainLibravatar Johannes Schindelin1-1/+1
This trick was performed via $ sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -- t/t5411/* In the previous commit, we adjusted roughly half of the support files, to stay under the 100kB limit (mails larger than that are rejected by the Git mailing list). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-08-27t5411: add basic test cases for proc-receive hookLibravatar Jiang Xin1-0/+56
Topic "proc-receive-hook" will change the workflow and output of git-push. Add some basic test cases in t5411 before introducing the new topic. Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>