diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-01-05 20:42:50 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-01-05 14:58:29 -0800 |
commit | 3f390a366cc4a083b11452b899a04416aea00bdd (patch) | |
tree | 9aecc8b8b64c9385d6f6247c448f1978e07739fa /t/t3800-mktag.sh | |
parent | mktag: allow omitting the header/body \n separator (diff) | |
download | tgif-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-x | t/t3800-mktag.sh | 12 |
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 |