From d576539c9255d22425efcc55f7e9720fbb8a42d1 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Mon, 22 Jan 2007 17:06:51 +0100 Subject: [PATCH] Do not skip the initialization of the date string. Due to some rebasing in the past, new functions that have been introduced upstream moved into the MinGW portion of the #ifdefs just by coincidend, but the initialization of the date string remained in the original spot. The consequence was that all commits that did not use GIT_*_DATE were created with an empty date part. This removes the second instance of setup_ident(), which was lacking the initialization. --- ident.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ident.c b/ident.c index 83ce631a06..145f54a505 100644 --- a/ident.c +++ b/ident.c @@ -45,8 +45,11 @@ static void copy_gecos(struct passwd *w, char *name, int sz) } +#endif + int setup_ident(void) { +#ifndef NO_ETC_PASSWD int len; struct passwd *pw = getpwuid(getuid()); @@ -74,13 +77,12 @@ int setup_ident(void) else strlcpy(git_default_email + len, "(none)", sizeof(git_default_email) - len); } +#endif /* And set the default date */ datestamp(git_default_date, sizeof(git_default_date)); return 0; } -#else /* NO_ETC_PASSWD */ - static int add_raw(char *buf, int size, int offset, const char *str) { int len = strlen(str); @@ -156,13 +158,6 @@ static int copy(char *buf, int size, int offset, const char *src) return offset; } -int setup_ident(void) -{ - return 0; -} - -#endif - static const char au_env[] = "GIT_AUTHOR_NAME"; static const char co_env[] = "GIT_COMMITTER_NAME"; static const char *env_hint =