summaryrefslogtreecommitdiff
path: root/t/t6300-for-each-ref.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-06-25 16:55:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-06-29 18:39:10 (GMT)
commitaa1462cc3d3b0c4c8ad6a60aaf31e0f3a424162d (patch)
tree59ef52faaddb398ce95f3564ea5bd895c69e047f /t/t6300-for-each-ref.sh
parenta5481a6c9438cbd9c246cfa59ff49c31a0926fb6 (diff)
downloadgit-aa1462cc3d3b0c4c8ad6a60aaf31e0f3a424162d.zip
git-aa1462cc3d3b0c4c8ad6a60aaf31e0f3a424162d.tar.gz
git-aa1462cc3d3b0c4c8ad6a60aaf31e0f3a424162d.tar.bz2
introduce "format" date-mode
This feeds the format directly to strftime. Besides being a little more flexible, the main advantage is that your system strftime may know more about your locale's preferred format (e.g., how to spell the days of the week). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6300-for-each-ref.sh')
-rwxr-xr-xt/t6300-for-each-ref.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index 24fc2ba..c7f368c 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -227,6 +227,14 @@ test_expect_success 'Check format "rfc2822" date fields output' '
test_cmp expected actual
'
+test_expect_success 'Check format of strftime date fields' '
+ echo "my date is 2006-07-03" >expected &&
+ git for-each-ref \
+ --format="%(authordate:format:my date is %Y-%m-%d)" \
+ refs/heads >actual &&
+ test_cmp expected actual
+'
+
cat >expected <<\EOF
refs/heads/master
refs/remotes/origin/master