Skip to content

Commit 294c695

Browse files
Amos WaterlandJunio C Hamano
authored andcommitted
git rebase loses author name/email if given bad email address
If GIT_AUTHOR_EMAIL is of a certain form, `git rebase master' will blow away the author name and email when fast-forward merging commits. I have not tracked it down, but here is a testcase that demonstrates the behavior. Signed-off-by: Amos Waterland <apw@us.ibm.com> Acked-by: Michal Ostrowski <mostrows@watson.ibm.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 32d9954 commit 294c695

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

t/t3400-rebase.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (c) 2005 Amos Waterland
4+
#
5+
6+
test_description='git rebase should not destroy author information
7+
8+
This test runs git rebase and checks that the author information is not lost.
9+
'
10+
. ./test-lib.sh
11+
12+
export GIT_AUTHOR_EMAIL=bogus_email_address
13+
14+
test_expect_success \
15+
'prepare repository with topic branch, then rebase against master' \
16+
'echo First > A &&
17+
git-update-index --add A &&
18+
git-commit -m "Add A." &&
19+
git checkout -b my-topic-branch &&
20+
echo Second > B &&
21+
git-update-index --add B &&
22+
git-commit -m "Add B." &&
23+
git checkout -f master &&
24+
echo Third >> A &&
25+
git-update-index A &&
26+
git-commit -m "Modify A." &&
27+
git checkout -f my-topic-branch &&
28+
git rebase master'
29+
30+
test_expect_failure \
31+
'the rebase operation should not have destroyed author information' \
32+
'git log | grep "Author:" | grep "<>"'
33+
34+
test_done

0 commit comments

Comments
 (0)