summaryrefslogtreecommitdiff
path: root/t/t6300-for-each-ref.sh
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2010-05-13 14:31:46 +0200
committerJunio C Hamano <gitster@pobox.com>2010-05-18 21:49:04 -0700
commit67687feae52ff2d3ab7edf3ac42a39c5e44be299 (patch)
treeba6200d9cbf29a9c1acaa17bfaa4a782d531b249 /t/t6300-for-each-ref.sh
parent04794fdc2701f15d79d92805cfe94c9e754e2e05 (diff)
downloadgit-67687feae52ff2d3ab7edf3ac42a39c5e44be299.tar.gz
for-each-ref: Field with abbreviated objectname
Introduce a :short modifier to objectname which outputs the abbreviated object name. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Reviewed-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.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index 8052c86ad3..7dc8a510c7 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -295,6 +295,15 @@ test_expect_success 'Check short upstream format' '
test_cmp expected actual
'
+cat >expected <<EOF
+67a36f1
+EOF
+
+test_expect_success 'Check short objectname format' '
+ git for-each-ref --format="%(objectname:short)" refs/heads >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'Check for invalid refname format' '
test_must_fail git for-each-ref --format="%(refname:INVALID)"
'