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: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn Pearce committed
Jul 10, 2006 at 20:27 UTC
0b0fe4a65d24d7c17d72706e5cd179ecc7134721
2 files changed
+1
-1
builtin-update-ref.c
+1
@@ -12,6 +12,7 @@ int cmd_update_ref(int argc, const char **argv, char **envp)
12
unsigned char sha1[20], oldsha1[20];
13
int i;
14
15
+ setup_ident();
16
setup_git_directory();
17
git_config(git_default_config);
18
refs.c
-1
@@ -379,7 +379,6 @@ static int log_ref_write(struct ref_lock *lock,
379
lock->log_file, strerror(errno));
380
}
381
382
- setup_ident();
382
committer = git_committer_info(1);
383
if (msg) {
384
maxlen = strlen(committer) + strlen(msg) + 2*40 + 5;