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.
This commit is contained in:
Johannes Sixt
2007-01-22 17:06:51 +01:00
parent 562cd8385d
commit d576539c92

13
ident.c
View File

@@ -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 =