Skip to content

Commit

Permalink
Merge branch 'jk/reset-ident-time-per-commit' into maint
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gitster committed Aug 12, 2016
2 parents 8e4b75a + 4d9c7e6 commit f4fd627
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions builtin/am.c
Original file line number Diff line number Diff line change
Expand Up @@ -1839,6 +1839,8 @@ static void am_run(struct am_state *state, int resume)
const char *mail = am_path(state, msgnum(state));
int apply_status;

reset_ident_date();

if (!file_exists(mail))
goto next;

Expand Down
1 change: 1 addition & 0 deletions cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,7 @@ extern const char *ident_default_email(void);
extern const char *git_editor(void);
extern const char *git_pager(int stdout_is_tty);
extern int git_ident_config(const char *, const char *, void *);
extern void reset_ident_date(void);

struct ident_split {
const char *name_begin;
Expand Down
5 changes: 5 additions & 0 deletions ident.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ static const char *ident_default_date(void)
return git_default_date.buf;
}

void reset_ident_date(void)
{
strbuf_reset(&git_default_date);
}

static int crud(unsigned char c)
{
return c <= 32 ||
Expand Down

0 comments on commit f4fd627

Please sign in to comment.