summaryrefslogtreecommitdiff
path: root/t/t3800-mktag.sh
diff options
context:
space:
mode:
authorLibravatar Ævar Arnfjörð Bjarmason <avarab@gmail.com>2021-01-05 20:42:50 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-01-05 14:58:29 -0800
commit3f390a366cc4a083b11452b899a04416aea00bdd (patch)
tree9aecc8b8b64c9385d6f6247c448f1978e07739fa /t/t3800-mktag.sh
parentmktag: allow omitting the header/body \n separator (diff)
downloadtgif-3f390a366cc4a083b11452b899a04416aea00bdd.tar.xz
mktag: convert to parse-options
Convert the "mktag" command to use parse-options.h instead of its own ad-hoc argc handling. This doesn't matter much in practice since it doesn't support any options, but removes another special-case in our codebase, and makes it easier to add options to it in the future. It does marginally improve the situation for programs that want to execute git commands in a consistent manner and e.g. always use --end-of-options. E.g. "gitaly" does that, and has a blacklist of built-ins that don't support --end-of-options. This is one less special case for it and other similar programs to support. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3800-mktag.sh')
-rwxr-xr-xt/t3800-mktag.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh
index 1fd97def33..98708659fd 100755
--- a/t/t3800-mktag.sh
+++ b/t/t3800-mktag.sh
@@ -45,6 +45,18 @@ test_expect_success 'setup' '
blob=$(git rev-parse --verify HEAD:B.t)
'
+test_expect_success 'basic usage' '
+ cat >tag.sig <<-EOF &&
+ object $head
+ type commit
+ tag mytag
+ tagger T A Gger <tagger@example.com> 1206478233 -0500
+ EOF
+ git mktag <tag.sig &&
+ git mktag --end-of-options <tag.sig &&
+ test_expect_code 129 git mktag --unknown-option
+'
+
############################################################
# 1. length check