]>
git.ipfire.org Git - thirdparty/git.git/blob - t/t9122-git-svn-author.sh
3 test_description
='git svn authorship'
5 TEST_FAILS_SANITIZE_LEAK
=true
8 test_expect_success
'setup svn repository' '
9 svn_cmd checkout "$svnrepo" work.svn &&
14 svn_cmd commit -m "first commit" file
18 test_expect_success
'interact with it via git svn' '
22 git svn init "$svnrepo" &&
25 echo modification >file &&
27 git commit -a -m second &&
32 echo "further modification" >file &&
34 git commit -a -m third &&
37 git svn --add-author-from dcommit &&
39 echo "yet further modification" >file &&
41 git commit -a -m fourth &&
44 git svn --add-author-from --use-log-author dcommit &&
48 git show -s HEAD^^ >../actual.2 &&
49 git show -s HEAD^ >../actual.3 &&
50 git show -s HEAD >../actual.4
54 # Make sure that --add-author-from without --use-log-author
55 # did not affect the authorship information
56 myself=$(grep "^Author: " actual.2) &&
57 unaffected=$(grep "^Author: " actual.3) &&
58 test "z$myself" = "z$unaffected" &&
60 # Make sure lack of --add-author-from did not add cruft
61 ! grep "^ From: A U Thor " actual.2 &&
63 # Make sure --add-author-from added cruft
64 grep "^ From: A U Thor " actual.3 &&
65 grep "^ From: A U Thor " actual.4 &&
67 # Make sure --add-author-from with --use-log-author affected
68 # the authorship information
69 grep "^Author: A U Thor " actual.4 &&
71 # Make sure there are no commit messages with excess blank lines
72 test $(grep "^ " actual.2 | wc -l) = 3 &&
73 test $(grep "^ " actual.3 | wc -l) = 5 &&
74 test $(grep "^ " actual.4 | wc -l) = 5 &&
76 # Make sure there are no svn commit messages with excess blank lines
81 test $(svn_cmd log -r2:2 | wc -l) = 5 &&
82 test $(svn_cmd log -r4:4 | wc -l) = 7