summaryrefslogtreecommitdiff
path: root/t/t5411/common-functions.sh
diff options
context:
space:
mode:
authorLibravatar Jiang Xin <worldhello.net@gmail.com>2020-11-11 19:32:00 +0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-11-11 12:46:55 -0800
commitcf3d868f353c4a5a9ecf4fbc2a44960671ba59cb (patch)
tree9084aee29e86c40f6bdc082d7044f2f993e73391 /t/t5411/common-functions.sh
parentt5411: finish preparing for `main` being the default branch name (diff)
downloadtgif-cf3d868f353c4a5a9ecf4fbc2a44960671ba59cb.tar.xz
t5411: new helper filter_out_user_friendly_and_stable_output
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>
Diffstat (limited to 't/t5411/common-functions.sh')
-rw-r--r--t/t5411/common-functions.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/t/t5411/common-functions.sh b/t/t5411/common-functions.sh
index 521a347710..344d13f61a 100644
--- a/t/t5411/common-functions.sh
+++ b/t/t5411/common-functions.sh
@@ -42,7 +42,7 @@ create_commits_in () {
make_user_friendly_and_stable_output () {
sed \
-e "s/ *\$//" \
- -e "s/ */ /g" \
+ -e "s/ */ /g" \
-e "s/'/\"/g" \
-e "s/ / /g" \
-e "s/$A/<COMMIT-A>/g" \
@@ -54,3 +54,8 @@ make_user_friendly_and_stable_output () {
-e "s#To $URL_PREFIX/upstream.git#To <URL/of/upstream.git>#" \
-e "/^error: / d"
}
+
+filter_out_user_friendly_and_stable_output () {
+ make_user_friendly_and_stable_output |
+ sed -n ${1+"$@"}
+}