Skip to content

Commit 5f35edd

Browse files
peffgitster
authored andcommitted
rebase: fix broken email with --committer-date-is-author-date
Commit 7573cec (rebase -i: support --committer-date-is-author-date, 2020-08-17) copied the committer ident-parsing code from builtin/am.c. And in doing so, it copied a bug in which we always set the email to an empty string. We fixed the version in git-am in the previous commit; this commit fixes the copied code. Reported-by: VenomVendor <[email protected]> Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 16b0bb9 commit 5f35edd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sequencer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4369,7 +4369,7 @@ static int init_committer(struct replay_opts *opts)
43694369
opts->committer_name =
43704370
xmemdupz(id.name_begin, id.name_end - id.name_begin);
43714371
opts->committer_email =
4372-
xmemdupz(id.mail_begin, id.mail_end - id.mail_end);
4372+
xmemdupz(id.mail_begin, id.mail_end - id.mail_begin);
43734373

43744374
return 0;
43754375
}

t/t3436-rebase-more-options.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,20 @@ test_expect_success '--committer-date-is-author-date works with apply backend' '
7676
test_ctime_is_atime -1
7777
'
7878

79-
test_expect_failure '--committer-date-is-author-date works with merge backend' '
79+
test_expect_success '--committer-date-is-author-date works with merge backend' '
8080
GIT_AUTHOR_DATE="@1234 +0300" git commit --amend --reset-author &&
8181
git rebase -m --committer-date-is-author-date HEAD^ &&
8282
test_ctime_is_atime -1
8383
'
8484

85-
test_expect_failure '--committer-date-is-author-date works with rebase -r' '
85+
test_expect_success '--committer-date-is-author-date works with rebase -r' '
8686
git checkout side &&
8787
GIT_AUTHOR_DATE="@1234 +0300" git merge --no-ff commit3 &&
8888
git rebase -r --root --committer-date-is-author-date &&
8989
test_ctime_is_atime
9090
'
9191

92-
test_expect_failure '--committer-date-is-author-date works when forking merge' '
92+
test_expect_success '--committer-date-is-author-date works when forking merge' '
9393
git checkout side &&
9494
GIT_AUTHOR_DATE="@1234 +0300" git merge --no-ff commit3 &&
9595
PATH="./test-bin:$PATH" git rebase -r --root --strategy=test \
@@ -145,7 +145,7 @@ test_expect_success '--reset-author-date works with rebase -r' '
145145
test_atime_is_ignored
146146
'
147147

148-
test_expect_failure '--reset-author-date with --committer-date-is-author-date works' '
148+
test_expect_success '--reset-author-date with --committer-date-is-author-date works' '
149149
test_must_fail git rebase -m --committer-date-is-author-date \
150150
--reset-author-date --onto commit2^^ commit2^ commit3 &&
151151
git checkout --theirs foo &&

0 commit comments

Comments
 (0)