diff options
author | Jiang Xin <worldhello.net@gmail.com> | 2020-11-11 11:32:00 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-11 20:46:55 (GMT) |
commit | cf3d868f353c4a5a9ecf4fbc2a44960671ba59cb (patch) | |
tree | 9084aee29e86c40f6bdc082d7044f2f993e73391 /t/t5411/common-functions.sh | |
parent | 5d5f4ea30def2ac765c5517f768366524768c110 (diff) | |
download | git-cf3d868f353c4a5a9ecf4fbc2a44960671ba59cb.zip git-cf3d868f353c4a5a9ecf4fbc2a44960671ba59cb.tar.gz git-cf3d868f353c4a5a9ecf4fbc2a44960671ba59cb.tar.bz2 |
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.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/t/t5411/common-functions.sh b/t/t5411/common-functions.sh index 521a347..344d13f 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+"$@"} +} |