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@xxxxxxxxx> Mentored-by: Christian Couder <christian.couder@xxxxxxxxx> Mentored by: Jeff King <peff@xxxxxxxx> --- 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