]> git.ipfire.org Git - thirdparty/git.git/commit
gpg-interface: refactor 'enum sign_mode' parsing
authorChristian Couder <christian.couder@gmail.com>
Wed, 17 Sep 2025 18:14:26 +0000 (20:14 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Sep 2025 18:18:28 +0000 (11:18 -0700)
commit2f8fd208c36bf2e88f949d0c4059214dfcb2a717
tree1c5822c96382e8802f3a90246728f09dc3832eef
parent4975ec3473b4bc61bc8a3df1ef29d0b7e7959e87
gpg-interface: refactor 'enum sign_mode' parsing

The definition of 'enum sign_mode' as well as its parsing code are in
"builtin/fast-export.c". This was fine because `git fast-export` was the
only command with '--signed-tags=<mode>' or '--signed-commits=<mode>'
options.

In a following commit, we are going to add a similar option to `git
fast-import`, which will be simpler, easier and cleaner if we can reuse
the 'enum sign_mode' defintion and parsing code.

So let's move that definition and parsing code from
"builtin/fast-export.c" to "gpg-interface.{c,h}".

While at it, let's fix a small indentation issue with the arguments of
parse_opt_sign_mode().

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fast-export.c
gpg-interface.c
gpg-interface.h