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 =