Skip to content

Commit

Permalink
Allow user.name and user.email to drive reflog entry.
Browse files Browse the repository at this point in the history
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: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Shawn Pearce authored and Junio C Hamano committed Jul 11, 2006
1 parent b75a82b commit 0b0fe4a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions builtin-update-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0b0fe4a

Please sign in to comment.