File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1856,6 +1856,11 @@ static char *get_extended_user_info(enum EXTENDED_NAME_FORMAT type)
18561856 return NULL ;
18571857}
18581858
1859+ char * mingw_query_user_email (void )
1860+ {
1861+ return get_extended_user_info (NameUserPrincipal );
1862+ }
1863+
18591864struct passwd * getpwuid (int uid )
18601865{
18611866 static unsigned initialized ;
Original file line number Diff line number Diff line change @@ -422,6 +422,8 @@ int mingw_offset_1st_component(const char *path);
422422#define PATH_SEP ';'
423423extern const char * program_data_config (void );
424424#define git_program_data_config program_data_config
425+ extern char * mingw_query_user_email (void );
426+ #define query_user_email mingw_query_user_email
425427#ifndef __MINGW64_VERSION_MAJOR
426428#define PRIuMAX "I64u"
427429#define PRId64 "I64d"
Original file line number Diff line number Diff line change @@ -379,6 +379,10 @@ static inline char *git_find_last_dir_sep(const char *path)
379379#define git_program_data_config () NULL
380380#endif
381381
382+ #ifndef query_user_email
383+ #define query_user_email () NULL
384+ #endif
385+
382386#if defined(__HP_cc ) && (__HP_cc >= 61000 )
383387#define NORETURN __attribute__((noreturn))
384388#define NORETURN_PTR
Original file line number Diff line number Diff line change @@ -168,7 +168,9 @@ const char *ident_default_email(void)
168168 strbuf_addstr (& git_default_email , email );
169169 committer_ident_explicitly_given |= IDENT_MAIL_GIVEN ;
170170 author_ident_explicitly_given |= IDENT_MAIL_GIVEN ;
171- } else
171+ } else if ((email = query_user_email ()) && email [0 ])
172+ strbuf_addstr (& git_default_email , email );
173+ else
172174 copy_email (xgetpwuid_self (& default_email_is_bogus ),
173175 & git_default_email , & default_email_is_bogus );
174176 strbuf_trim (& git_default_email );
You can’t perform that action at this time.
0 commit comments