From: Junio C Hamano Date: Wed, 19 May 2021 23:55:00 +0000 (+0900) Subject: Merge branch 'zh/ref-filter-push-remote-fix' X-Git-Tag: v2.32.0-rc1~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=36a255acd14779ef21747b56341796e18c229976;p=thirdparty%2Fgit.git Merge branch 'zh/ref-filter-push-remote-fix' The handling of "%(push)" formatting element of "for-each-ref" and friends was broken when the same codepath started handling "%(push:)", which has been corrected. * zh/ref-filter-push-remote-fix: ref-filter: fix read invalid union member bug --- 36a255acd14779ef21747b56341796e18c229976 diff --cc t/t6302-for-each-ref-filter.sh index 9866b1b573,529ca556c8..1537aa2179 --- a/t/t6302-for-each-ref-filter.sh +++ b/t/t6302-for-each-ref-filter.sh @@@ -117,9 -113,28 +117,28 @@@ test_expect_success '%(color) must fail test_must_fail git for-each-ref --format="%(color)%(refname)" ' + test_expect_success '%(color:#aa22ac) must succeed' ' + test_when_finished rm -rf test && + git init test && + ( + cd test && + test_commit initial && + git branch -M main && + cat >expect <<-\EOF && + refs/heads/main + refs/tags/initial + EOF + git remote add origin nowhere && + git config branch.main.remote origin && + git config branch.main.merge refs/heads/main && + git for-each-ref --format="%(color:#aa22ac)%(refname)" >actual && + test_cmp expect actual + ) + ' + test_expect_success 'left alignment is default' ' cat >expect <<-\EOF && - refname is refs/heads/master |refs/heads/master + refname is refs/heads/main |refs/heads/main refname is refs/heads/side |refs/heads/side refname is refs/odd/spot |refs/odd/spot refname is refs/tags/annotated-tag|refs/tags/annotated-tag