diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-10-02 12:26:12 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-10-02 12:26:12 -0700 |
| commit | f2d464b9f5a3983b3c5208ae41c81de6b2fdc4cf (patch) | |
| tree | 68b89eb12fc98a093b3fd04389eebb86ff6a18bf /gpg-interface.c | |
| parent | db0babf9b2f807e6913b3591d04cb752b8219e9d (diff) | |
| parent | eaaddf57912466414bce5bf81a24d1d69caf2e51 (diff) | |
| download | git-f2d464b9f5a3983b3c5208ae41c81de6b2fdc4cf.tar.xz | |
Merge branch 'cc/fast-import-strip-signed-commits'
"git fast-import" learned that "--signed-commits=<how>" option that
corresponds to that of "git fast-export".
* cc/fast-import-strip-signed-commits:
fast-import: add '--signed-commits=<mode>' option
gpg-interface: refactor 'enum sign_mode' parsing
Diffstat (limited to 'gpg-interface.c')
| -rw-r--r-- | gpg-interface.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gpg-interface.c b/gpg-interface.c index 06e7fb5060..2f4f0e32cb 100644 --- a/gpg-interface.c +++ b/gpg-interface.c @@ -1125,3 +1125,20 @@ out: FREE_AND_NULL(ssh_signing_key_file); return ret; } + +int parse_sign_mode(const char *arg, enum sign_mode *mode) +{ + if (!strcmp(arg, "abort")) + *mode = SIGN_ABORT; + else if (!strcmp(arg, "verbatim") || !strcmp(arg, "ignore")) + *mode = SIGN_VERBATIM; + else if (!strcmp(arg, "warn-verbatim") || !strcmp(arg, "warn")) + *mode = SIGN_WARN_VERBATIM; + else if (!strcmp(arg, "warn-strip")) + *mode = SIGN_WARN_STRIP; + else if (!strcmp(arg, "strip")) + *mode = SIGN_STRIP; + else + return -1; + return 0; +} |
