diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-05-20 02:55:00 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-05-20 02:55:00 +0300 |
commit | 36a255acd14779ef21747b56341796e18c229976 (patch) | |
tree | d7b0215e9e11a7c6a0f928be492f47a27bce1356 /t | |
parent | bdff0419da0e81a6fb957d38fd6cff06e3ffb4e3 (diff) | |
parent | 1e1c4c5eac972516db47394ae94a52a3b97cb41a (diff) |
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:<what>)", which has been corrected.
* zh/ref-filter-push-remote-fix:
ref-filter: fix read invalid union member bug
Diffstat (limited to 't')
-rwxr-xr-x | t/t6302-for-each-ref-filter.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh index 9866b1b573..1537aa2179 100755 --- a/t/t6302-for-each-ref-filter.sh +++ b/t/t6302-for-each-ref-filter.sh @@ -117,6 +117,25 @@ 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/main |refs/heads/main |