File tree Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1790,6 +1790,11 @@ static char *get_extended_user_info(enum EXTENDED_NAME_FORMAT type)
1790
1790
return NULL ;
1791
1791
}
1792
1792
1793
+ char * mingw_query_user_email (void )
1794
+ {
1795
+ return get_extended_user_info (NameUserPrincipal );
1796
+ }
1797
+
1793
1798
struct passwd * getpwuid (int uid )
1794
1799
{
1795
1800
static unsigned initialized ;
Original file line number Diff line number Diff line change @@ -414,6 +414,8 @@ static inline void convert_slashes(char *path)
414
414
int mingw_offset_1st_component (const char * path );
415
415
#define offset_1st_component mingw_offset_1st_component
416
416
#define PATH_SEP ';'
417
+ extern char * mingw_query_user_email (void );
418
+ #define query_user_email mingw_query_user_email
417
419
#if !defined(__MINGW64_VERSION_MAJOR ) && (!defined(_MSC_VER ) || _MSC_VER < 1800 )
418
420
#define PRIuMAX "I64u"
419
421
#define PRId64 "I64d"
Original file line number Diff line number Diff line change @@ -370,6 +370,10 @@ static inline char *git_find_last_dir_sep(const char *path)
370
370
#define find_last_dir_sep git_find_last_dir_sep
371
371
#endif
372
372
373
+ #ifndef query_user_email
374
+ #define query_user_email () NULL
375
+ #endif
376
+
373
377
#if defined(__HP_cc ) && (__HP_cc >= 61000 )
374
378
#define NORETURN __attribute__((noreturn))
375
379
#define NORETURN_PTR
Original file line number Diff line number Diff line change @@ -169,7 +169,9 @@ const char *ident_default_email(void)
169
169
strbuf_addstr (& git_default_email , email );
170
170
committer_ident_explicitly_given |= IDENT_MAIL_GIVEN ;
171
171
author_ident_explicitly_given |= IDENT_MAIL_GIVEN ;
172
- } else
172
+ } else if ((email = query_user_email ()) && email [0 ])
173
+ strbuf_addstr (& git_default_email , email );
174
+ else
173
175
copy_email (xgetpwuid_self (& default_email_is_bogus ),
174
176
& git_default_email , & default_email_is_bogus );
175
177
strbuf_trim (& git_default_email );
You can’t perform that action at this time.
0 commit comments