Code

Allow user.name and user.email to drive reflog entry.
authorShawn Pearce <spearce@spearce.org>
Tue, 11 Jul 2006 00:27:54 +0000 (20:27 -0400)
committerJunio C Hamano <junkio@cox.net>
Tue, 11 Jul 2006 04:12:40 +0000 (21:12 -0700)
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>
builtin-update-ref.c
refs.c

index 00333c7e7ca0e706be425182ff92b98a16ac3883..83094abe0f20d36bf2d9e65539fb2c8b7a5644fc 100644 (file)
@@ -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);
 
diff --git a/refs.c b/refs.c
index 2d9c1dc5d385b9bfcce293ba6d2c21018b9ae0af..56db394459cec2cd156ee2243a1dbac33867f926 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -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;