From: Junio C Hamano Date: Thu, 8 Jul 2021 20:15:01 +0000 (-0700) Subject: Merge branch 'jx/sideband-cleanup' X-Git-Tag: v2.33.0-rc0~87 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7cc114737164886ef526f74e023d85a2ad011d6d;p=thirdparty%2Fgit.git Merge branch 'jx/sideband-cleanup' The side-band demultiplexer that is used to display progress output from the remote end did not clear the line properly when the end of line hits at a packet boundary, which has been corrected. Also comes with test clean-ups. * jx/sideband-cleanup: test: refactor to use "get_abbrev_oid" to get abbrev oid test: refactor to use "test_commit" to create commits test: compare raw output, not mangle tabs and spaces sideband: don't lose clear-to-eol at packet boundary --- 7cc114737164886ef526f74e023d85a2ad011d6d diff --cc t/t6020-bundle-misc.sh index 3140ca4fdc,cf13bcc3c8..b13e8a52a9 --- a/t/t6020-bundle-misc.sh +++ b/t/t6020-bundle-misc.sh @@@ -80,43 -80,34 +80,46 @@@ test_commit_setvar () eval $var=$oid } +get_abbrev_oid () { + oid=$1 && + suffix=${oid#???????} && + oid=${oid%$suffix} && + if test -n "$oid" + then + echo "$oid" + else + echo "undefined-oid" + fi +} + # Format the output of git commands to make a user-friendly and stable # text. We can easily prepare the expect text without having to worry - # about future changes of the commit ID and spaces of the output. + # about future changes of the commit ID. make_user_friendly_and_stable_output () { sed \ - -e "s/${A%${A#???????}}[0-9a-f]*//g" \ - -e "s/${B%${B#???????}}[0-9a-f]*//g" \ - -e "s/${C%${C#???????}}[0-9a-f]*//g" \ - -e "s/${D%${D#???????}}[0-9a-f]*//g" \ - -e "s/${E%${E#???????}}[0-9a-f]*//g" \ - -e "s/${F%${F#???????}}[0-9a-f]*//g" \ - -e "s/${G%${G#???????}}[0-9a-f]*//g" \ - -e "s/${H%${H#???????}}[0-9a-f]*//g" \ - -e "s/${I%${I#???????}}[0-9a-f]*//g" \ - -e "s/${J%${J#???????}}[0-9a-f]*//g" \ - -e "s/${K%${K#???????}}[0-9a-f]*//g" \ - -e "s/${L%${L#???????}}[0-9a-f]*//g" \ - -e "s/${M%${M#???????}}[0-9a-f]*//g" \ - -e "s/${N%${N#???????}}[0-9a-f]*//g" \ - -e "s/${O%${O#???????}}[0-9a-f]*//g" \ - -e "s/${P%${P#???????}}[0-9a-f]*//g" \ - -e "s/${TAG1%${TAG1#???????}}[0-9a-f]*//g" \ - -e "s/${TAG2%${TAG2#???????}}[0-9a-f]*//g" \ - -e "s/${TAG3%${TAG3#???????}}[0-9a-f]*//g" + -e "s/$(get_abbrev_oid $A)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $B)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $C)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $D)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $E)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $F)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $G)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $H)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $I)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $J)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $K)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $L)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $M)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $N)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $O)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $P)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $TAG1)[0-9a-f]*//g" \ + -e "s/$(get_abbrev_oid $TAG2)[0-9a-f]*//g" \ - -e "s/$(get_abbrev_oid $TAG3)[0-9a-f]*//g" \ - -e "s/ *\$//" ++ -e "s/$(get_abbrev_oid $TAG3)[0-9a-f]*//g" + } + + format_and_save_expect () { + sed -e 's/Z$//' >expect } # (C) (D, pull/1/head, topic/1)