summaryrefslogtreecommitdiff
path: root/t/t3400-rebase.sh
diff options
context:
space:
mode:
authorJay Soffian <jaysoffian@gmail.com>2010-06-16 07:12:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-06-16 17:00:58 (GMT)
commit43c23251f924db4188cf74361cb7cc3257accce3 (patch)
treeccbd22fa90b8684d728b2984bc6aab042b7f5d6f /t/t3400-rebase.sh
parente0a9110176e3b17414b1b38fae8febd0791eaa0c (diff)
downloadgit-43c23251f924db4188cf74361cb7cc3257accce3.zip
git-43c23251f924db4188cf74361cb7cc3257accce3.tar.gz
git-43c23251f924db4188cf74361cb7cc3257accce3.tar.bz2
am: use get_author_ident_from_commit instead of mailinfo when rebasing
In certain situations, commit authorship can consist of an invalid e-mail address. For example, this is the case when working with git svn repos where the author email has had the svn repo UUID appended such as: author@example.com <author@example.com@deadbeef-dead-beef-dead-beefdeadbeef> Given such an address, mailinfo extracts the authorship incorrectly as it assumes a valid domain. However, when rebasing the original authorship should be preserved irrespective of its validity as an email address. Using get_author_ident_from_commit instead of mailinfo when rebasing preserves the original authorship. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3400-rebase.sh')
-rwxr-xr-xt/t3400-rebase.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index dbf7dfb..c41bcc7 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -10,8 +10,9 @@ among other things.
'
. ./test-lib.sh
-GIT_AUTHOR_EMAIL=bogus_email_address
-export GIT_AUTHOR_EMAIL
+GIT_AUTHOR_NAME=author@name
+GIT_AUTHOR_EMAIL=bogus@email@address
+export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL
test_expect_success \
'prepare repository with topic branches' \
@@ -80,6 +81,10 @@ test_expect_success \
'the rebase operation should not have destroyed author information' \
'! (git log | grep "Author:" | grep "<>")'
+test_expect_success \
+ 'the rebase operation should not have destroyed author information (2)' \
+ "git log -1 | grep 'Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>'"
+
test_expect_success 'HEAD was detached during rebase' '
test $(git rev-parse HEAD@{1}) != $(git rev-parse my-topic-branch@{1})
'