Skip to content

Commit 4f9f7c1

Browse files
committed
Merge branch 'jk/committer-date-is-author-date-fix' into maint
In 2.29, "--committer-date-is-author-date" option of "rebase" and "am" subcommands lost the e-mail address by mistake, which has been corrected. * jk/committer-date-is-author-date-fix: rebase: fix broken email with --committer-date-is-author-date am: fix broken email with --committer-date-is-author-date t3436: check --committer-date-is-author-date result more carefully
2 parents b927c80 + 5f35edd commit 4f9f7c1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

builtin/am.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static void am_state_init(struct am_state *state)
161161
state->committer_name =
162162
xmemdupz(id.name_begin, id.name_end - id.name_begin);
163163
state->committer_email =
164-
xmemdupz(id.mail_begin, id.mail_end - id.mail_end);
164+
xmemdupz(id.mail_begin, id.mail_end - id.mail_begin);
165165
}
166166

167167
/**
@@ -1595,7 +1595,7 @@ static void do_commit(const struct am_state *state)
15951595

15961596
if (state->committer_date_is_author_date)
15971597
committer = fmt_ident(state->committer_name,
1598-
state->author_email, WANT_COMMITTER_IDENT,
1598+
state->committer_email, WANT_COMMITTER_IDENT,
15991599
state->ignore_date ? NULL
16001600
: state->author_date,
16011601
IDENT_STRICT);

sequencer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4478,7 +4478,7 @@ static int init_committer(struct replay_opts *opts)
44784478
opts->committer_name =
44794479
xmemdupz(id.name_begin, id.name_end - id.name_begin);
44804480
opts->committer_email =
4481-
xmemdupz(id.mail_begin, id.mail_end - id.mail_end);
4481+
xmemdupz(id.mail_begin, id.mail_end - id.mail_begin);
44824482

44834483
return 0;
44844484
}

t/t3436-rebase-more-options.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ test_expect_success '--ignore-whitespace is remembered when continuing' '
6565
'
6666

6767
test_ctime_is_atime () {
68-
git log $1 --format=%ai >authortime &&
69-
git log $1 --format=%ci >committertime &&
68+
git log $1 --format="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> %ai" >authortime &&
69+
git log $1 --format="%cn <%ce> %ci" >committertime &&
7070
test_cmp authortime committertime
7171
}
7272

0 commit comments

Comments
 (0)