diff options
author | Jeff King <peff@peff.net> | 2012-11-14 16:34:13 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-11-15 17:47:24 -0800 |
commit | d6991ceedc6a6fbcc2184f8328eb1b4c88b55267 (patch) | |
tree | bdf8bdcc36cf08cc1b3b3550deea078aa83d381b /cache.h | |
parent | 452802309c422ce71f1c038357ee0775af5fb3eb (diff) | |
download | git-d6991ceedc6a6fbcc2184f8328eb1b4c88b55267.tar.gz |
ident: keep separate "explicit" flags for author and committer
We keep track of whether the user ident was given to us
explicitly, or if we guessed at it from system parameters
like username and hostname. However, we kept only a single
variable. This covers the common cases (because the author
and committer will usually come from the same explicit
source), but can miss two cases:
1. GIT_COMMITTER_* is set explicitly, but we fallback for
GIT_AUTHOR. We claim the ident is explicit, even though
the author is not.
2. GIT_AUTHOR_* is set and we ask for author ident, but
not committer ident. We will claim the ident is
implicit, even though it is explicit.
This patch uses two variables instead of one, updates both
when we set the "fallback" values, and updates them
individually when we read from the environment.
Rather than keep user_ident_sufficiently_given as a
compatibility wrapper, we update the only two callers to
check the committer_ident, which matches their intent and
what was happening already.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1149,7 +1149,8 @@ struct config_include_data { #define CONFIG_INCLUDE_INIT { 0 } extern int git_config_include(const char *name, const char *value, void *data); -extern int user_ident_sufficiently_given(void); +extern int committer_ident_sufficiently_given(void); +extern int author_ident_sufficiently_given(void); extern const char *git_commit_encoding; extern const char *git_log_output_encoding; |