提交 0b0fe4a6 编写于 作者: S Shawn Pearce 提交者: Junio C Hamano

Allow user.name and user.email to drive reflog entry.

Apparently calling setup_ident() after git_config causes the
user.name and user.email values read from the config file to be
replaced with the data obtained from the host.  This means that
users who have setup their email address in user.email will instead
be writing reflog entries with their hostname.

Moving setup_ident() to before git_config in update-ref resolves
this ordering problem.
Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 b75a82b7
......@@ -12,6 +12,7 @@ int cmd_update_ref(int argc, const char **argv, char **envp)
unsigned char sha1[20], oldsha1[20];
int i;
setup_ident();
setup_git_directory();
git_config(git_default_config);
......
......@@ -379,7 +379,6 @@ static int log_ref_write(struct ref_lock *lock,
lock->log_file, strerror(errno));
}
setup_ident();
committer = git_committer_info(1);
if (msg) {
maxlen = strlen(committer) + strlen(msg) + 2*40 + 5;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册