summaryrefslogtreecommitdiff
path: root/t/t1503-rev-parse-verify.sh
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2008-05-11 18:27:36 +0200
committerJunio C Hamano <gitster@pobox.com>2008-05-11 11:36:07 -0700
commit28bfa145e4dedad9b2c81857b77ca13871c77853 (patch)
tree56bb50b80e3977dc9f28f3fa5d2b5853876c634b /t/t1503-rev-parse-verify.sh
parent921df15f1d276bdecb7c4e134dff97f4e3adf953 (diff)
downloadgit-28bfa145e4dedad9b2c81857b77ca13871c77853.tar.gz
rev-parse: fix using "--default" with "--verify"
Before this patch, something like: $ git rev-parse --verify HEAD --default master did not work, while: $ git rev-parse --default master --verify HEAD worked. This patch fixes that, so that they both work (assuming HEAD and master can be parsed). Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1503-rev-parse-verify.sh')
-rwxr-xr-xt/t1503-rev-parse-verify.sh11
1 files changed, 5 insertions, 6 deletions
diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh
index a0d14cb9c3..e93f1b38ef 100755
--- a/t/t1503-rev-parse-verify.sh
+++ b/t/t1503-rev-parse-verify.sh
@@ -97,18 +97,17 @@ test_expect_failure '3 no stdout output on error' '
test -z "$(git rev-parse --verify $HASH2 HEAD)"
'
-test_expect_success '1 with --default' '
+test_expect_success 'use --default' '
git rev-parse --verify --default master &&
git rev-parse --verify --default master HEAD &&
git rev-parse --default master --verify &&
git rev-parse --default master --verify HEAD &&
+ git rev-parse --verify HEAD --default master &&
test_must_fail git rev-parse --verify foo --default master &&
test_must_fail git rev-parse --default HEAD --verify bar &&
- test_must_fail git rev-parse --verify --default HEAD baz
-'
-
-test_expect_failure '2 with --default' '
- git rev-parse --verify HEAD --default master
+ test_must_fail git rev-parse --verify --default HEAD baz &&
+ test_must_fail git rev-parse --default foo --verify &&
+ test_must_fail git rev-parse --verify --default bar
'
test_done