[PATCH 3/6] auto-crlf tests: check "git checkout" exit code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Don't hide the exit code from the "git checkout" we run to checkout
our attributes file.

This fixes cases where we'd have e.g. missed memory leaks under
SANITIZE=leak, this code doesn't leak (the relevant "git checkout"
leak has been fixed), but in a past version of git we'd continue past
this failure under SANITIZE=leak when these invocations had errored
out, even under "--immediate".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
---
 t/t0027-auto-crlf.sh | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh
index 7f80f463930..03b955b774f 100755
--- a/t/t0027-auto-crlf.sh
+++ b/t/t0027-auto-crlf.sh
@@ -293,11 +293,17 @@ checkout_files () {
 	pfx=eol_${ceol}_crlf_${crlf}_attr_${attr}_ &&
 	for f in LF CRLF LF_mix_CR CRLF_mix_LF LF_nul
 	do
-		rm crlf_false_attr__$f.txt &&
-		if test -z "$ceol"; then
-			git checkout -- crlf_false_attr__$f.txt
+		if test -z "$ceol"
+		then
+			test_expect_success "setup $f checkout" '
+				rm crlf_false_attr__$f.txt &&
+				git checkout -- crlf_false_attr__$f.txt
+			'
 		else
-			git -c core.eol=$ceol checkout -- crlf_false_attr__$f.txt
+			test_expect_success "setup $f checkout with core.eol=$ceol" '
+				rm crlf_false_attr__$f.txt &&
+				git -c core.eol=$ceol checkout -- crlf_false_attr__$f.txt
+			'
 		fi
 	done
 
-- 
2.37.1.1095.g64a1e8362fd




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux