summaryrefslogtreecommitdiff
path: root/t/t7103-reset-bare.sh
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-03-07 12:48:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-03-07 21:27:39 (GMT)
commitc4d1d526312a2dbe39c7997cb5a08cfce12f2427 (patch)
tree933d3ae40a18bf154a36d58d0276c288c188676e /t/t7103-reset-bare.sh
parent715d08a9e51251ad8290b181b6ac3b9e1f9719d7 (diff)
downloadgit-c4d1d526312a2dbe39c7997cb5a08cfce12f2427.zip
git-c4d1d526312a2dbe39c7997cb5a08cfce12f2427.tar.gz
git-c4d1d526312a2dbe39c7997cb5a08cfce12f2427.tar.bz2
tests: change some 'test $(git) = "x"' to test_cmp
Change some of the patterns in the test suite where we were hiding the exit code from "git" by invoking it in a sub-shell within a "test" expression to use temporary files and test_cmp instead. These are not all the occurrences of this anti-pattern, but these in particular hid issues where LSAN was dying, and I'd thus marked these tests as passing under the linux-leaks CI job in past commits with "TEST_PASSES_SANITIZE_LEAK=true". Let's deal with that by either removing that marking, or skipping specific tests under !SANITIZE_LEAK. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7103-reset-bare.sh')
-rwxr-xr-xt/t7103-reset-bare.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/t/t7103-reset-bare.sh b/t/t7103-reset-bare.sh
index 0de83e3..a60153f 100755
--- a/t/t7103-reset-bare.sh
+++ b/t/t7103-reset-bare.sh
@@ -63,9 +63,12 @@ test_expect_success '"mixed" reset is not allowed in bare' '
test_must_fail git reset --mixed HEAD^
'
-test_expect_success '"soft" reset is allowed in bare' '
+test_expect_success !SANITIZE_LEAK '"soft" reset is allowed in bare' '
git reset --soft HEAD^ &&
- test "$(git show --pretty=format:%s | head -n 1)" = "one"
+ git show --pretty=format:%s >out &&
+ echo one >expect &&
+ head -n 1 out >actual &&
+ test_cmp expect actual
'
test_done