Skip to content

Commit 9aebc47

Browse files
avargitster
authored andcommitted
upload-pack tests: avoid a non-zero "grep" exit status
Continue changing a test that 763b47b (t5703: stop losing return codes of git commands, 2019-11-27) already refactored. This was originally added as part of a series to add support for running under bash's "set -o pipefail", under that mode this test will fail because sometimes there's no commits in the "objs" output. It's easier to fix that than exempt these tests under a hypothetical "set -o pipefail" test mode. It looks like we probably won't have that, but once we've dug this code up let's refactor it[2] so we don't hide a potential pipe failure. 1. https://lore.kernel.org/git/[email protected]/ Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 796c248 commit 9aebc47

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

t/t5703-upload-pack-ref-in-want.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ get_actual_commits () {
1616
test-tool pkt-line unpack-sideband <out >o.pack &&
1717
git index-pack o.pack &&
1818
git verify-pack -v o.idx >objs &&
19-
grep commit objs | cut -d" " -f1 | sort >actual_commits
19+
sed -n -e 's/\([0-9a-f][0-9a-f]*\) commit .*/\1/p' objs >objs.sed &&
20+
sort >actual_commits <objs.sed
2021
}
2122

2223
check_output () {

0 commit comments

Comments
 (0)