summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2007-11-10 16:47:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-10 19:04:24 (GMT)
commitc899a57c28ee7cf251f856b575128de21b5a9a12 (patch)
treea983ad33b599da48d9538123996bca9d14c344cd /t
parenta130976b71f36c73fc6279fd02beb1f798d82487 (diff)
downloadgit-c899a57c28ee7cf251f856b575128de21b5a9a12.zip
git-c899a57c28ee7cf251f856b575128de21b5a9a12.tar.gz
git-c899a57c28ee7cf251f856b575128de21b5a9a12.tar.bz2
for-each-ref: fix setup of option-parsing for --sort
The option value for --sort is already a pointer to a pointer to struct ref_sort, so just use it. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t6300-for-each-ref.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index d0809eb..c722635 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -148,4 +148,26 @@ test_expect_success 'Check format "rfc2822" date fields output' '
git diff expected actual
'
+cat >expected <<\EOF
+refs/heads/master
+refs/tags/testtag
+EOF
+
+test_expect_success 'Verify ascending sort' '
+ git-for-each-ref --format="%(refname)" --sort=refname >actual &&
+ git diff expected actual
+'
+
+
+cat >expected <<\EOF
+refs/tags/testtag
+refs/heads/master
+EOF
+
+test_expect_success 'Verify descending sort' '
+ git-for-each-ref --format="%(refname)" --sort=-refname >actual &&
+ git diff expected actual
+'
+
+
test_done