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 @@ -1871,6 +1871,11 @@ static char *get_extended_user_info(enum EXTENDED_NAME_FORMAT type)
1871
1871
return NULL ;
1872
1872
}
1873
1873
1874
+ char * mingw_query_user_email (void )
1875
+ {
1876
+ return get_extended_user_info (NameUserPrincipal );
1877
+ }
1878
+
1874
1879
struct passwd * getpwuid (int uid )
1875
1880
{
1876
1881
static unsigned initialized ;
Original file line number Diff line number Diff line change @@ -429,6 +429,8 @@ int mingw_offset_1st_component(const char *path);
429
429
#define PATH_SEP ';'
430
430
extern const char * program_data_config (void );
431
431
#define git_program_data_config program_data_config
432
+ extern char * mingw_query_user_email (void );
433
+ #define query_user_email mingw_query_user_email
432
434
#if !defined(__MINGW64_VERSION_MAJOR ) && (!defined(_MSC_VER ) || _MSC_VER < 1800 )
433
435
#define PRIuMAX "I64u"
434
436
#define PRId64 "I64d"
Original file line number Diff line number Diff line change @@ -376,6 +376,10 @@ static inline char *git_find_last_dir_sep(const char *path)
376
376
#define git_program_data_config () NULL
377
377
#endif
378
378
379
+ #ifndef query_user_email
380
+ #define query_user_email () NULL
381
+ #endif
382
+
379
383
#if defined(__HP_cc ) && (__HP_cc >= 61000 )
380
384
#define NORETURN __attribute__((noreturn))
381
385
#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