[PATCH RFC 22/24] for-each-ref: tests for new atoms added
- From
Olga Telezhnaya <olyatelezhnaya@gmail.com>
- Date
- Jan 26, 2018, 19:43 UTC
- Message-ID
- <0102016133ff3b7d-d733e1b6-eb98-4033-ba86-83fc6323887b-000000@eu-west-1.amazonses.com>
- In-Reply-To
- <0102016133ff3a86-44d354ec-13c6-4c38-bc75-1ba4422db5a7-000000@eu-west-1.amazonses.com>
Add tests for new formatting atoms: rest, deltabase, objectsize:disk. rest means nothing and we expand it into empty string. We need this atom for cat-file command. Have plans to support deltabase and objectsize:disk further (as it is done in cat-file), now also expand it to empty string.
Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com> Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored by: Jeff King <peff@peff.net> --- t/t6300-for-each-ref.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh index c128dfc579079..eee656a6abba9 100755 --- a/t/t6300-for-each-ref.sh +++ b/t/t6300-for-each-ref.sh @@ -316,6 +316,24 @@ test_expect_success 'exercise strftime with odd fields' ' test_cmp expected actual ' +test_expect_success 'Check format %(objectsize:disk) gives empty output ' ' + echo >expected && + git for-each-ref --format="%(objectsize:disk)" refs/heads >actual && + test_cmp expected actual +' + +test_expect_success 'Check format %(rest) gives empty output ' ' + echo >expected && + git for-each-ref --format="%(rest)" refs/heads >actual && + test_cmp expected actual +' + +test_expect_success 'Check format %(deltabase) gives empty output ' ' + echo >expected && + git for-each-ref --format="%(deltabase)" refs/heads >actual && + test_cmp expected actual +' + cat >expected <<\EOF refs/heads/master refs/remotes/origin/master -- https://github.com/git/git/pull/452