Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-01-05 22:42:50 +0300
committerJunio C Hamano <gitster@pobox.com>2021-01-06 01:58:29 +0300
commit3f390a366cc4a083b11452b899a04416aea00bdd (patch)
tree9aecc8b8b64c9385d6f6247c448f1978e07739fa /t/t3800-mktag.sh
parent9a1a3a4d4c5648b94dbe8f34b83271d96dbaa6ec (diff)
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