Skip to content

Commit 5f3bfdc

Browse files
avargitster
authored andcommitted
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 ea05fd5 (Merge branch 'ab/keep-git-exit-codes-in-tests', 2022-03-16) topic for prior art. This fixes code added in b45563a (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e7e5c6f commit 5f3bfdc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

t/t4023-diff-rename-typechange.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ test_expect_success setup '
5252
'
5353

5454
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 &&
5757
{
5858
echo "R100 foo bar" &&
5959
echo "R100 bar foo"
@@ -63,8 +63,8 @@ test_expect_success 'cross renames to be detected for regular files' '
6363
'
6464

6565
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 &&
6868
{
6969
echo "R100 foo bar" &&
7070
echo "R100 bar foo"
@@ -74,8 +74,8 @@ test_expect_success 'cross renames to be detected for typechange' '
7474
'
7575

7676
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 &&
7979
{
8080
# see -B -M (#6) in t4008
8181
echo "C100 foo bar" &&

0 commit comments

Comments
 (0)