Skip to content

Commit efbb763

Browse files
derrickstoleegitster
authored andcommitted
t5516: fix test order flakiness
The 'fetch follows tags by default' test sorts using 'sort -k 4', but for-each-ref output only has 3 columns. This relies on sort treating records with fewer fields as having an empty fourth field, which may produce unstable results depending on locale. Use 'sort -k 3' to match the actual number of columns in the output. Signed-off-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 6e8d538 commit efbb763

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t5516-fetch-push.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ test_expect_success 'fetch follows tags by default' '
13491349
git for-each-ref >tmp1 &&
13501350
sed -n "p; s|refs/heads/main$|refs/remotes/origin/main|p" tmp1 |
13511351
sed -n "p; s|refs/heads/main$|refs/remotes/origin/HEAD|p" |
1352-
sort -k 4 >../expect
1352+
sort -k 3 >../expect
13531353
) &&
13541354
test_when_finished "rm -rf dst" &&
13551355
git init dst &&

0 commit comments

Comments
 (0)