Skip to content

Commit a6ecc25

Browse files
avargitster
authored andcommitted
rev-list simplify tests: don't ignore "git" exit code
Change a fragile test pattern introduced in 6534703 (Topo-sort before --simplify-merges, 2008-08-03) to check the exit code of both "git name-rev" and "git log". This test as a whole would fail under SANITIZE=leak, but we'd pass several "failing" tests due to hiding these exit codes before we'd spot git dying with abort(). Now we'll instead spot all of the failures. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c419562 commit a6ecc25

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

t/t6012-rev-list-simplify.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ note () {
1212
}
1313

1414
unnote () {
15-
git name-rev --tags --annotate-stdin | sed -e "s|$OID_REGEX (tags/\([^)]*\)) |\1 |g"
15+
test_when_finished "rm -f tmp" &&
16+
git name-rev --tags --annotate-stdin >tmp &&
17+
sed -e "s|$OID_REGEX (tags/\([^)]*\)) |\1 |g" <tmp
1618
}
1719

1820
#
@@ -111,8 +113,8 @@ check_outcome () {
111113
shift &&
112114
param="$*" &&
113115
test_expect_$outcome "log $param" '
114-
git log --pretty="$FMT" --parents $param |
115-
unnote >actual &&
116+
git log --pretty="$FMT" --parents $param >out &&
117+
unnote >actual <out &&
116118
sed -e "s/^.* \([^ ]*\) .*/\1/" >check <actual &&
117119
test_cmp expect check
118120
'
@@ -151,8 +153,8 @@ check_result 'L K I H G B' --exclude-first-parent-only --first-parent L ^F
151153
check_result 'E C B A' --full-history E -- lost
152154
test_expect_success 'full history simplification without parent' '
153155
printf "%s\n" E C B A >expect &&
154-
git log --pretty="$FMT" --full-history E -- lost |
155-
unnote >actual &&
156+
git log --pretty="$FMT" --full-history E -- lost >out &&
157+
unnote >actual <out &&
156158
sed -e "s/^.* \([^ ]*\) .*/\1/" >check <actual &&
157159
test_cmp expect check
158160
'

0 commit comments

Comments
 (0)