Skip to content

Commit 0b0fe4a

Browse files
spearceJunio C Hamano
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b75a82b commit 0b0fe4a

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

builtin-update-ref.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ int cmd_update_ref(int argc, const char **argv, char **envp)
1212
unsigned char sha1[20], oldsha1[20];
1313
int i;
1414

15+
setup_ident();
1516
setup_git_directory();
1617
git_config(git_default_config);
1718

refs.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ static int log_ref_write(struct ref_lock *lock,
379379
lock->log_file, strerror(errno));
380380
}
381381

382-
setup_ident();
383382
committer = git_committer_info(1);
384383
if (msg) {
385384
maxlen = strlen(committer) + strlen(msg) + 2*40 + 5;

0 commit comments

Comments
 (0)