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 @@ -1856,6 +1856,11 @@ static char *get_extended_user_info(enum EXTENDED_NAME_FORMAT type)
1856
1856
return NULL ;
1857
1857
}
1858
1858
1859
+ char * mingw_query_user_email (void )
1860
+ {
1861
+ return get_extended_user_info (NameUserPrincipal );
1862
+ }
1863
+
1859
1864
struct passwd * getpwuid (int uid )
1860
1865
{
1861
1866
static unsigned initialized ;
Original file line number Diff line number Diff line change @@ -428,6 +428,8 @@ int mingw_offset_1st_component(const char *path);
428
428
#define PATH_SEP ';'
429
429
extern const char * program_data_config (void );
430
430
#define git_program_data_config program_data_config
431
+ extern char * mingw_query_user_email (void );
432
+ #define query_user_email mingw_query_user_email
431
433
#ifndef __MINGW64_VERSION_MAJOR
432
434
#define PRIuMAX "I64u"
433
435
#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)
379
379
#define git_program_data_config () NULL
380
380
#endif
381
381
382
+ #ifndef query_user_email
383
+ #define query_user_email () NULL
384
+ #endif
385
+
382
386
#if defined(__HP_cc ) && (__HP_cc >= 61000 )
383
387
#define NORETURN __attribute__((noreturn))
384
388
#define NORETURN_PTR
Original file line number Diff line number Diff line change @@ -171,7 +171,9 @@ const char *ident_default_email(void)
171
171
strbuf_addstr (& git_default_email , email );
172
172
committer_ident_explicitly_given |= IDENT_MAIL_GIVEN ;
173
173
author_ident_explicitly_given |= IDENT_MAIL_GIVEN ;
174
- } else
174
+ } else if ((email = query_user_email ()) && email [0 ])
175
+ strbuf_addstr (& git_default_email , email );
176
+ else
175
177
copy_email (xgetpwuid_self (& default_email_is_bogus ),
176
178
& git_default_email , & default_email_is_bogus );
177
179
strbuf_trim (& git_default_email );
You can’t perform that action at this time.
0 commit comments