From: Junio C Hamano Date: Tue, 21 Mar 2017 22:03:30 +0000 (-0700) Subject: Merge branch 'jk/t6300-cleanup' into maint X-Git-Tag: v2.12.2~12 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7e02ec2c5d2e54df0300e5035fbb952e8dcf302c?ds=inline;hp=-c Merge branch 'jk/t6300-cleanup' into maint A test that creates a confusing branch whose name is HEAD has been corrected not to do so. * jk/t6300-cleanup: t6300: avoid creating refs/heads/HEAD --- 7e02ec2c5d2e54df0300e5035fbb952e8dcf302c diff --combined t/t6300-for-each-ref.sh index aea1dfc714,37e021f30e..a468041c50 --- a/t/t6300-for-each-ref.sh +++ b/t/t6300-for-each-ref.sh @@@ -558,34 -558,9 +558,34 @@@ test_expect_success 'do not dereferenc test_when_finished "git checkout master" && git for-each-ref --format="%(HEAD) %(refname:short)" refs/heads/ >actual && sed -e "s/^\* / /" actual >expect && - git checkout --orphan HEAD && + git checkout --orphan orphaned-branch && git for-each-ref --format="%(HEAD) %(refname:short)" refs/heads/ >actual && test_cmp expect actual ' +cat >trailers < +Signed-off-by: A U Thor +EOF + +test_expect_success 'basic atom: head contents:trailers' ' + echo "Some contents" > two && + git add two && + git commit -F - <<-EOF && + trailers: this commit message has trailers + + Some message contents + + $(cat trailers) + EOF + git for-each-ref --format="%(contents:trailers)" refs/heads/master >actual && + sanitize_pgp actual.clean && + # git for-each-ref ends with a blank line + cat >expect <<-EOF && + $(cat trailers) + + EOF + test_cmp expect actual.clean +' + test_done