l10n: README: fix typo
[alt-git.git] / t / t9122-git-svn-author.sh
blob527ba3d29322a14d609ea57e3740672f144f3182
1 #!/bin/sh
3 test_description='git svn authorship'
5 TEST_FAILS_SANITIZE_LEAK=true
6 . ./lib-git-svn.sh
8 test_expect_success 'setup svn repository' '
9 svn_cmd checkout "$svnrepo" work.svn &&
11 cd work.svn &&
12 echo >file &&
13 svn_cmd add file &&
14 svn_cmd commit -m "first commit" file
18 test_expect_success 'interact with it via git svn' '
19 mkdir work.git &&
21 cd work.git &&
22 git svn init "$svnrepo" &&
23 git svn fetch &&
25 echo modification >file &&
26 test_tick &&
27 git commit -a -m second &&
29 test_tick &&
30 git svn dcommit &&
32 echo "further modification" >file &&
33 test_tick &&
34 git commit -a -m third &&
36 test_tick &&
37 git svn --add-author-from dcommit &&
39 echo "yet further modification" >file &&
40 test_tick &&
41 git commit -a -m fourth &&
43 test_tick &&
44 git svn --add-author-from --use-log-author dcommit &&
46 git log &&
48 git show -s HEAD^^ >../actual.2 &&
49 git show -s HEAD^ >../actual.3 &&
50 git show -s HEAD >../actual.4
52 ) &&
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
78 cd work.svn &&
79 svn_cmd up &&
81 test $(svn_cmd log -r2:2 | wc -l) = 5 &&
82 test $(svn_cmd log -r4:4 | wc -l) = 7
86 test_done