t4023: fix ignored exit codes of git
Change a "git diff-tree" command to be &&-chained so that we won't ignore its exit code, see the ea05fd5fbf7 (Merge branch 'ab/keep-git-exit-codes-in-tests', 2022-03-16) topic for prior art. This fixes code added in b45563a229f (rename: Break filepairs with different types., 2007-11-30). Due to hiding the exit code we hid a memory leak under SANITIZE=leak. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Dec 2, 2022 at 01:06 UTC
5f3bfdc4f3de4800737dd0f5df25c10497894178
1 file changed
+6
-6
t/t4023-diff-rename-typechange.sh
+6
-6
@@ -52,8 +52,8 @@ test_expect_success setup '
52
'
53
54
test_expect_success 'cross renames to be detected for regular files' '
55
-
56
- git diff-tree five six -r --name-status -B -M | sort >actual &&
55
+ git diff-tree five six -r --name-status -B -M >out &&
56
+ sort out >actual &&
57
{
58
echo "R100 foo bar" &&
59
echo "R100 bar foo"
@@ -63,8 +63,8 @@ test_expect_success 'cross renames to be detected for regular files' '
63
'
64
65
test_expect_success 'cross renames to be detected for typechange' '
66
-
67
- git diff-tree one two -r --name-status -B -M | sort >actual &&
66
+ git diff-tree one two -r --name-status -B -M >out &&
67
+ sort out >actual &&
68
{
69
echo "R100 foo bar" &&
70
echo "R100 bar foo"
@@ -74,8 +74,8 @@ test_expect_success 'cross renames to be detected for typechange' '
74
'
75
76
test_expect_success 'moves and renames' '
77
-
78
- git diff-tree three four -r --name-status -B -M | sort >actual &&
77
+ git diff-tree three four -r --name-status -B -M >out &&
78
+ sort out >actual &&
79
{
80
# see -B -M (#6) in t4008
81
echo "C100 foo bar" &&