diff --git a/Makefile b/Makefile index 7add7b4fb8..0dc4200561 100644 --- a/Makefile +++ b/Makefile @@ -500,7 +500,6 @@ ifneq (,$(findstring MINGW,$(uname_S))) NO_CURL=YesPlease NO_SYMLINK_HEAD=YesPlease NO_IPV6=YesPlease - NO_ETC_PASSWD=YesPlease NO_SETENV=YesPlease NO_UNSETENV=YesPlease NO_STRCASESTR=YesPlease @@ -513,7 +512,7 @@ ifneq (,$(findstring MINGW,$(uname_S))) NO_MKDTEMP = YesPlease NO_SVN_TESTS=YesPlease NO_PERL_MAKEMAKER=YesPlease - COMPAT_CFLAGS += -DNO_ETC_PASSWD -DNO_ST_BLOCKS -DSTRIP_EXTENSION=\".exe\" -D__USE_MINGW_ACCESS -DNOGDI -I compat + COMPAT_CFLAGS += -DNO_ST_BLOCKS -DSTRIP_EXTENSION=\".exe\" -D__USE_MINGW_ACCESS -DNOGDI -I compat COMPAT_OBJS += compat/mingw.o compat/fnmatch.o compat/regex.o EXTLIBS += -lws2_32 X = .exe diff --git a/git-compat-util.h b/git-compat-util.h index 7cf6269c42..66c4fb37a5 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -63,8 +63,6 @@ int mkstemp (char *__template); #include #include #include -#endif -#ifndef NO_ETC_PASSWD #include #include #include @@ -431,7 +429,6 @@ int symlink(const char *oldpath, const char *newpath); int fchmod(int fildes, mode_t mode); int lstat(const char *file_name, struct stat *buf); -/* missing: link, mkstemp, fchmod, getuid (?), gettimeofday */ int socketpair(int d, int type, int protocol, int sv[2]); #define AF_UNIX 0 #define SOCK_STREAM 0 diff --git a/ident.c b/ident.c index 1f99984d76..9b2a852cb0 100644 --- a/ident.c +++ b/ident.c @@ -9,8 +9,6 @@ static char git_default_date[50]; -#ifndef NO_ETC_PASSWD - static void copy_gecos(const struct passwd *w, char *name, size_t sz) { char *src, *dst; @@ -72,11 +70,8 @@ static void copy_email(const struct passwd *pw) } } -#endif - static void setup_ident(void) { -#ifndef NO_ETC_PASSWD struct passwd *pw = NULL; /* Get the name ("gecos") */ @@ -101,7 +96,6 @@ static void setup_ident(void) copy_email(pw); } } -#endif /* And set the default date */ if (!git_default_date[0]) @@ -212,9 +206,7 @@ const char *fmt_ident(const char *name, const char *email, email = git_default_email; if (!*name) { -#ifndef NO_ETC_PASSWD struct passwd *pw; -#endif if (0 <= error_on_no_name && name == git_default_name && env_hint) { @@ -223,16 +215,11 @@ const char *fmt_ident(const char *name, const char *email, } if (0 < error_on_no_name) die("empty ident %s <%s> not allowed", name, email); -#ifndef NO_ETC_PASSWD pw = getpwuid(getuid()); if (!pw) die("You don't exist. Go away!"); strlcpy(git_default_name, pw->pw_name, sizeof(git_default_name)); -#else - strlcpy(git_default_name, "unknown", - sizeof(git_default_name)); -#endif name = git_default_name; } diff --git a/path.c b/path.c index 2c5ebfb922..e264bb34a9 100644 --- a/path.c +++ b/path.c @@ -141,8 +141,6 @@ int validate_headref(const char *path) return -1; } -#ifndef NO_ETC_PASSWD - static char *user_path(char *buf, char *path, int sz) { struct passwd *pw; @@ -182,15 +180,6 @@ static char *user_path(char *buf, char *path, int sz) return buf; } -#else - -static char *user_path(char *buf, char *path, int sz) -{ - return getenv("HOME"); -} - -#endif - /* * First, one directory to try is determined by the following algorithm. *