diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-12-20 10:14:54 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-12-20 10:14:55 -0800 |
| commit | 66e959f4316dcfd5eca8fcd3e0072415277753ea (patch) | |
| tree | e4fe76592881ba5c3a2f4d63b1de7b1fccb56d2c /sequencer.c | |
| parent | 2b9cbc6d01ba3e54de09efde1dd2ed46c2d36e94 (diff) | |
| parent | ea8f9494aba052fd531f674f78dba55f084bdc34 (diff) | |
| download | git-66e959f4316dcfd5eca8fcd3e0072415277753ea.tar.gz | |
Merge branch 'jk/config-cleanup'
Code clean-up around use of configuration variables.
* jk/config-cleanup:
sequencer: simplify away extra git_config_string() call
gpg-interface: drop pointless config_error_nonbool() checks
push: drop confusing configset/callback redundancy
config: use git_config_string() for core.checkRoundTripEncoding
diff: give more detailed messages for bogus diff.* config
config: use config_error_nonbool() instead of custom messages
imap-send: don't use git_die_config() inside callback
git_xmerge_config(): prefer error() to die()
config: reject bogus values for core.checkstat
Diffstat (limited to 'sequencer.c')
| -rw-r--r-- | sequencer.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/sequencer.c b/sequencer.c index d584cac8ed..74c3b1243e 100644 --- a/sequencer.c +++ b/sequencer.c @@ -238,34 +238,29 @@ static int git_sequencer_config(const char *k, const char *v, const struct config_context *ctx, void *cb) { struct replay_opts *opts = cb; - int status; if (!strcmp(k, "commit.cleanup")) { - const char *s; + if (!v) + return config_error_nonbool(k); - status = git_config_string(&s, k, v); - if (status) - return status; - - if (!strcmp(s, "verbatim")) { + if (!strcmp(v, "verbatim")) { opts->default_msg_cleanup = COMMIT_MSG_CLEANUP_NONE; opts->explicit_cleanup = 1; - } else if (!strcmp(s, "whitespace")) { + } else if (!strcmp(v, "whitespace")) { opts->default_msg_cleanup = COMMIT_MSG_CLEANUP_SPACE; opts->explicit_cleanup = 1; - } else if (!strcmp(s, "strip")) { + } else if (!strcmp(v, "strip")) { opts->default_msg_cleanup = COMMIT_MSG_CLEANUP_ALL; opts->explicit_cleanup = 1; - } else if (!strcmp(s, "scissors")) { + } else if (!strcmp(v, "scissors")) { opts->default_msg_cleanup = COMMIT_MSG_CLEANUP_SCISSORS; opts->explicit_cleanup = 1; } else { warning(_("invalid commit message cleanup mode '%s'"), - s); + v); } - free((char *)s); - return status; + return 0; } if (!strcmp(k, "commit.gpgsign")) { |
