diff options
author | Lars Hjemli <hjemli@gmail.com> | 2007-11-10 17:47:54 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-11-10 11:04:24 -0800 |
commit | c899a57c28ee7cf251f856b575128de21b5a9a12 (patch) | |
tree | a983ad33b599da48d9538123996bca9d14c344cd /t/t6300-for-each-ref.sh | |
parent | a130976b71f36c73fc6279fd02beb1f798d82487 (diff) | |
download | git-c899a57c28ee7cf251f856b575128de21b5a9a12.tar.gz |
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/t6300-for-each-ref.sh')
-rwxr-xr-x | t/t6300-for-each-ref.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh index d0809eb651..c722635050 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 |