http: respect protocol.*.allow=user for http-alternates
[gitweb.git] / ident.c
diff --git a/ident.c b/ident.c
index 4fd82d104365c2e2c1ab7e1597e7e246c8eded24..e20a772dde4230b0871ffe85a5204919402aaf94 100644 (file)
--- a/ident.c
+++ b/ident.c
@@ -75,14 +75,12 @@ static int add_mailname_host(struct strbuf *buf)
        mailname = fopen("/etc/mailname", "r");
        if (!mailname) {
                if (errno != ENOENT)
-                       warning("cannot open /etc/mailname: %s",
-                               strerror(errno));
+                       warning_errno("cannot open /etc/mailname");
                return -1;
        }
        if (strbuf_getline(&mailnamebuf, mailname) == EOF) {
                if (ferror(mailname))
-                       warning("cannot read /etc/mailname: %s",
-                               strerror(errno));
+                       warning_errno("cannot read /etc/mailname");
                strbuf_release(&mailnamebuf);
                fclose(mailname);
                return -1;
@@ -125,7 +123,7 @@ static void add_domainname(struct strbuf *out, int *is_bogus)
        char buf[1024];
 
        if (gethostname(buf, sizeof(buf))) {
-               warning("cannot get host name: %s", strerror(errno));
+               warning_errno("cannot get host name");
                strbuf_addstr(out, "(none)");
                *is_bogus = 1;
                return;
@@ -186,6 +184,11 @@ static const char *ident_default_date(void)
        return git_default_date.buf;
 }
 
+void reset_ident_date(void)
+{
+       strbuf_reset(&git_default_date);
+}
+
 static int crud(unsigned char c)
 {
        return  c <= 32  ||