diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2018-10-15 02:47:08 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-16 12:59:57 +0900 |
commit | 501afcb8b021611758bf07d0e18fa8ff7fbbed73 (patch) | |
tree | 57f92e7957ba23bf9b0315825742c6ae7815c098 /ident.c | |
parent | 564be791f33a72d28497420dafbd3b272b9a1380 (diff) | |
download | git-501afcb8b021611758bf07d0e18fa8ff7fbbed73.tar.gz |
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 <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ident.c')
-rw-r--r-- | ident.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); |