]> git.ipfire.org Git - thirdparty/git.git/commitdiff
mailinfo: don't discard names under 3 characters
authoredef <edef@edef.eu>
Sun, 16 May 2021 15:07:19 +0000 (15:07 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 16 May 2021 22:35:43 +0000 (07:35 +0900)
I sometimes receive patches from people with short mononyms, and in my
cultural environment these are not uncommon. To my dismay, git-am
currently discards their names, and replaces them with their email
addresses.

Link: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/
Signed-off-by: edef <edef@edef.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
mailinfo.c

index 5681d9130db6f54971cf2b966d1743b87a130b86..3161a3940f339f7e87a74983c8d204d5db3bcf6f 100644 (file)
@@ -19,7 +19,7 @@ static void cleanup_space(struct strbuf *sb)
 static void get_sane_name(struct strbuf *out, struct strbuf *name, struct strbuf *email)
 {
        struct strbuf *src = name;
-       if (name->len < 3 || 60 < name->len || strpbrk(name->buf, "@<>"))
+       if (!name->len || 60 < name->len || strpbrk(name->buf, "@<>"))
                src = email;
        else if (name == out)
                return;