summaryrefslogtreecommitdiff
path: root/t/t1503-rev-parse-verify.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-11-21 15:14:38 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-11-21 15:14:38 -0800
commit0dd171f0bc59f8f1a5bb6741276c35caf2d4117d (patch)
tree853538d38c33aa929a2a8208bc15f191b231adcb /t/t1503-rev-parse-verify.sh
parentMerge branch 'jc/format-patch-name-max' (diff)
parentrev-parse: handle --end-of-options (diff)
downloadtgif-0dd171f0bc59f8f1a5bb6741276c35caf2d4117d.tar.xz
Merge branch 'jk/rev-parse-end-of-options'
"git rev-parse" learned the "--end-of-options" to help scripts to safely take a parameter that is supposed to be a revision, e.g. "git rev-parse --verify -q --end-of-options $rev". * jk/rev-parse-end-of-options: rev-parse: handle --end-of-options rev-parse: put all options under the "-" check rev-parse: don't accept options after dashdash
Diffstat (limited to 't/t1503-rev-parse-verify.sh')
-rwxr-xr-xt/t1503-rev-parse-verify.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh
index 492edffa9c..dc9fe3cbf1 100755
--- a/t/t1503-rev-parse-verify.sh
+++ b/t/t1503-rev-parse-verify.sh
@@ -144,4 +144,17 @@ test_expect_success SYMLINKS 'ref resolution not confused by broken symlinks' '
test_must_fail git rev-parse --verify broken
'
+test_expect_success 'options can appear after --verify' '
+ git rev-parse --verify HEAD >expect &&
+ git rev-parse --verify -q HEAD >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'verify respects --end-of-options' '
+ git update-ref refs/heads/-tricky HEAD &&
+ git rev-parse --verify HEAD >expect &&
+ git rev-parse --verify --end-of-options -tricky >actual &&
+ test_cmp expect actual
+'
+
test_done