fmt_ident: drop IDENT_WARN_ON_NO_NAME code
authorJeff King <peff@peff.net>
Mon, 21 May 2012 23:10:11 +0000 (19:10 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 22 May 2012 16:07:54 +0000 (09:07 -0700)
There are no more callers who want this, so we can drop it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
ident.c

diff --git a/cache.h b/cache.h
index f63b71ff669cf8111013e70ef8cef4048af8cc48..65cbab55646e6ef5735323966925673fdae47464 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -887,9 +887,8 @@ unsigned long approxidate_careful(const char *, int *);
 unsigned long approxidate_relative(const char *date, const struct timeval *now);
 enum date_mode parse_date_format(const char *format);
 
-#define IDENT_WARN_ON_NO_NAME  1
-#define IDENT_ERROR_ON_NO_NAME 2
-#define IDENT_NO_DATE         4
+#define IDENT_ERROR_ON_NO_NAME 1
+#define IDENT_NO_DATE         2
 extern const char *git_author_info(int);
 extern const char *git_committer_info(int);
 extern const char *fmt_ident(const char *name, const char *email, const char *date_str, int);
diff --git a/ident.c b/ident.c
index acb3a0843f40a10a730a80e7fcbf896660184a42..3b92c4465448dfc6c5c275f968a12d7adbf73871 100644 (file)
--- a/ident.c
+++ b/ident.c
@@ -316,7 +316,6 @@ const char *fmt_ident(const char *name, const char *email,
        char date[50];
        int i;
        int error_on_no_name = (flag & IDENT_ERROR_ON_NO_NAME);
-       int warn_on_no_name = (flag & IDENT_WARN_ON_NO_NAME);
        int name_addr_only = (flag & IDENT_NO_DATE);
 
        if (!name)
@@ -327,13 +326,11 @@ const char *fmt_ident(const char *name, const char *email,
        if (!*name) {
                struct passwd *pw;
 
-               if ((warn_on_no_name || error_on_no_name) &&
-                   name == git_default_name && env_hint) {
-                       fputs(env_hint, stderr);
-                       env_hint = NULL; /* warn only once */
-               }
-               if (error_on_no_name)
+               if (error_on_no_name) {
+                       if (name == git_default_name)
+                               fputs(env_hint, stderr);
                        die("empty ident %s <%s> not allowed", name, email);
+               }
                pw = getpwuid(getuid());
                if (!pw)
                        die("You don't exist. Go away!");