Re: [PATCH v3 1/7] t5516: fix test order flakiness
- From
Matthew John Cheetham <mjcheetham@outlook.com>
- Date
- May 12, 2026, 10:50 UTC
- Message-ID
- <VI0PR03MB11634950671960EF7C54CE0ECC0392@VI0PR03MB11634.eurprd03.prod.outlook.com>
- In-Reply-To
- <466c56abe002ed2ac8cf0da2d6d1d8c288cd232b.1776871546.git.gitgitgadget@gmail.com>
On 2026-04-22 16:25, Derrick Stolee via GitGitGadget wrote:
Show 26 quoted lines
> From: Derrick Stolee <stolee@gmail.com> > > 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> > --- > t/t5516-fetch-push.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh > index 29e2f17608..ac8447f21e 100755 > --- a/t/t5516-fetch-push.sh > +++ b/t/t5516-fetch-push.sh > @@ -1349,7 +1349,7 @@ test_expect_success 'fetch follows tags by default' ' > git for-each-ref >tmp1 && > sed -n "p; s|refs/heads/main$|refs/remotes/origin/main|p" tmp1 | > sed -n "p; s|refs/heads/main$|refs/remotes/origin/HEAD|p" | > - sort -k 4 >../expect > + sort -k 3 >../expect > ) && > test_when_finished "rm -rf dst" && > git init dst &&
Makes sense. Looks like 3f763ddf28 ("fetch: set remote/HEAD if it does not exist") originally changed it from -k3 to -k4 by mistake.
Thanks, Matthew