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>
This commit is contained in:

committed by
Junio C Hamano

parent
452802309c
commit
d6991ceedc
3
cache.h
3
cache.h
@ -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;
|
||||
|
Reference in New Issue
Block a user