From 501afcb8b021611758bf07d0e18fa8ff7fbbed73 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 15 Oct 2018 02:47:08 -0700 Subject: mingw: use domain information for default email When a user is registered in a Windows domain, it is really easy to obtain the email address. So let's do that. Suggested by Lutz Roeder. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- ident.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ident.c') diff --git a/ident.c b/ident.c index 327abe557f..33bcf40644 100644 --- a/ident.c +++ b/ident.c @@ -168,6 +168,9 @@ const char *ident_default_email(void) strbuf_addstr(&git_default_email, email); committer_ident_explicitly_given |= IDENT_MAIL_GIVEN; author_ident_explicitly_given |= IDENT_MAIL_GIVEN; + } else if ((email = query_user_email()) && email[0]) { + strbuf_addstr(&git_default_email, email); + free((char *)email); } else copy_email(xgetpwuid_self(&default_email_is_bogus), &git_default_email, &default_email_is_bogus); -- cgit v1.3-5-g9baa