From: Olga Telezhnaya Date: Mon, 12 Feb 2018 08:08:54 GMT Subject: [PATCH v3 21/23] for-each-ref: tests for new atoms added Message-ID: <01020161890f438c-9d30a51c-129c-4721-a85a-a3d66a2270b6-000000@eu-west-1.amazonses.com> In-Reply-To: <01020161890f4236-47989eb4-c19f-4282-9084-9d4f90c2ebeb-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 Mentored-by: Christian Couder Mentored by: Jeff King --- 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