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 @@ -1959,6 +1959,11 @@ static char *get_extended_user_info(enum EXTENDED_NAME_FORMAT type)
1959
1959
return NULL ;
1960
1960
}
1961
1961
1962
+ char * mingw_query_user_email (void )
1963
+ {
1964
+ return get_extended_user_info (NameUserPrincipal );
1965
+ }
1966
+
1962
1967
struct passwd * getpwuid (int uid )
1963
1968
{
1964
1969
static unsigned initialized ;
Original file line number Diff line number Diff line change @@ -433,6 +433,8 @@ int mingw_offset_1st_component(const char *path);
433
433
#define PATH_SEP ';'
434
434
extern const char * program_data_config (void );
435
435
#define git_program_data_config program_data_config
436
+ extern char * mingw_query_user_email (void );
437
+ #define query_user_email mingw_query_user_email
436
438
#ifndef __MINGW64_VERSION_MAJOR
437
439
#define PRIuMAX "I64u"
438
440
#define PRId64 "I64d"
Original file line number Diff line number Diff line change @@ -373,6 +373,10 @@ static inline char *git_find_last_dir_sep(const char *path)
373
373
#define git_program_data_config () NULL
374
374
#endif
375
375
376
+ #ifndef query_user_email
377
+ #define query_user_email () NULL
378
+ #endif
379
+
376
380
#if defined(__HP_cc ) && (__HP_cc >= 61000 )
377
381
#define NORETURN __attribute__((noreturn))
378
382
#define NORETURN_PTR
Original file line number Diff line number Diff line change @@ -168,7 +168,9 @@ const char *ident_default_email(void)
168
168
strbuf_addstr (& git_default_email , email );
169
169
committer_ident_explicitly_given |= IDENT_MAIL_GIVEN ;
170
170
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
172
174
copy_email (xgetpwuid_self (& default_email_is_bogus ),
173
175
& git_default_email , & default_email_is_bogus );
174
176
strbuf_trim (& git_default_email );
You can’t perform that action at this time.
0 commit comments