Skip to content

Commit f4fd627

Browse files
committed
Merge branch 'jk/reset-ident-time-per-commit' into maint
Not-so-recent rewrite of "git am" that started making internal calls into the commit machinery had an unintended regression, in that no matter how many seconds it took to apply many patches, the resulting committer timestamp for the resulting commits were all the same. * jk/reset-ident-time-per-commit: am: reset cached ident date for each patch
2 parents 8e4b75a + 4d9c7e6 commit f4fd627

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

builtin/am.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,6 +1839,8 @@ static void am_run(struct am_state *state, int resume)
18391839
const char *mail = am_path(state, msgnum(state));
18401840
int apply_status;
18411841

1842+
reset_ident_date();
1843+
18421844
if (!file_exists(mail))
18431845
goto next;
18441846

cache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,7 @@ extern const char *ident_default_email(void);
12621262
extern const char *git_editor(void);
12631263
extern const char *git_pager(int stdout_is_tty);
12641264
extern int git_ident_config(const char *, const char *, void *);
1265+
extern void reset_ident_date(void);
12651266

12661267
struct ident_split {
12671268
const char *name_begin;

ident.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ static const char *ident_default_date(void)
184184
return git_default_date.buf;
185185
}
186186

187+
void reset_ident_date(void)
188+
{
189+
strbuf_reset(&git_default_date);
190+
}
191+
187192
static int crud(unsigned char c)
188193
{
189194
return c <= 32 ||

0 commit comments

Comments
 (0)