rev-list simplify tests: don't ignore "git" exit code
Change a fragile test pattern introduced in 65347030590 (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 <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Mar 7, 2022 at 13:49 UTC
a6ecc256c34c42a8b9f1790d9bfb5ea8f6309022
1 file changed
+7
-5
t/t6012-rev-list-simplify.sh
+7
-5
@@ -12,7 +12,9 @@ note () {
12
}
13
14
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
18
}
19
20
#
@@ -111,8 +113,8 @@ check_outcome () {
113
shift &&
114
param="$*" &&
115
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 &&
118
sed -e "s/^.* \([^ ]*\) .*/\1/" >check <actual &&
119
test_cmp expect check
120
'
@@ -151,8 +153,8 @@ check_result 'L K I H G B' --exclude-first-parent-only --first-parent L ^F
153
check_result 'E C B A' --full-history E -- lost
154
test_expect_success 'full history simplification without parent' '
155
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 &&
158
sed -e "s/^.* \([^ ]*\) .*/\1/" >check <actual &&
159
test_cmp expect check
160
'