aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-05-25 13:37:25 -0700
committerJunio C Hamano <gitster@pobox.com>2008-05-25 13:37:25 -0700
commit834836bd3f1c817f93ee69a29c904d3333e635f0 (patch)
tree4dbae0f8d93bfe5add63c90db43dc0cbd941b6a2 /t
parent6c99f18660f62f90b83f0592c81ab6a4092d6d13 (diff)
parent27554e900dd0e2b91b578f2e01c38b3eba746a77 (diff)
downloadgit-834836bd3f1c817f93ee69a29c904d3333e635f0.tar.gz
git-834836bd3f1c817f93ee69a29c904d3333e635f0.tar.xz
Merge branch 'ap/svn'
* ap/svn: git-svn: add test for --add-author-from and --use-log-author git-svn: add documentation for --add-author-from option. git-svn: Add --add-author-from option. git-svn: add documentation for --use-log-author option.
Diffstat (limited to 't')
-rwxr-xr-xt/t9122-git-svn-author.sh70
1 files changed, 70 insertions, 0 deletions
diff --git a/t/t9122-git-svn-author.sh b/t/t9122-git-svn-author.sh
new file mode 100755
index 000000000..8c58f0b8d
--- /dev/null
+++ b/t/t9122-git-svn-author.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+test_description='git svn authorship'
+. ./lib-git-svn.sh
+
+test_expect_success 'setup svn repository' '
+ svn checkout "$svnrepo" work.svn &&
+ (
+ cd work.svn &&
+ echo >file
+ svn add file
+ svn commit -m "first commit" file
+ )
+'
+
+test_expect_success 'interact with it via git-svn' '
+ mkdir work.git &&
+ (
+ cd work.git &&
+ git svn init "$svnrepo"
+ git svn fetch &&
+
+ echo modification >file &&
+ test_tick &&
+ git commit -a -m second &&
+
+ test_tick &&
+ git svn dcommit &&
+
+ echo "further modification" >file &&
+ test_tick &&
+ git commit -a -m third &&
+
+ test_tick &&
+ git svn --add-author-from dcommit &&
+
+ echo "yet further modification" >file &&
+ test_tick &&
+ git commit -a -m fourth &&
+
+ test_tick &&
+ git svn --add-author-from --use-log-author dcommit &&
+
+ git log &&
+
+ git show -s HEAD^^ >../actual.2 &&
+ git show -s HEAD^ >../actual.3 &&
+ git show -s HEAD >../actual.4
+
+ ) &&
+
+ # Make sure that --add-author-from without --use-log-author
+ # did not affect the authorship information
+ myself=$(grep "^Author: " actual.2) &&
+ unaffected=$(grep "^Author: " actual.3) &&
+ test "z$myself" = "z$unaffected" &&
+
+ # Make sure lack of --add-author-from did not add cruft
+ ! grep "^ From: A U Thor " actual.2 &&
+
+ # Make sure --add-author-from added cruft
+ grep "^ From: A U Thor " actual.3 &&
+ grep "^ From: A U Thor " actual.4 &&
+
+ # Make sure --add-author-from with --use-log-author affected
+ # the authorship information
+ grep "^Author: A U Thor " actual.4
+'
+
+test_done