]>
Commit | Line | Data |
---|---|---|
27554e90 JH |
1 | #!/bin/sh |
2 | ||
3 | test_description='git svn authorship' | |
7a98d9ab | 4 | |
27554e90 JH |
5 | . ./lib-git-svn.sh |
6 | ||
7 | test_expect_success 'setup svn repository' ' | |
da083d68 | 8 | svn_cmd checkout "$svnrepo" work.svn && |
27554e90 JH |
9 | ( |
10 | cd work.svn && | |
cff4243d ES |
11 | echo >file && |
12 | svn_cmd add file && | |
da083d68 | 13 | svn_cmd commit -m "first commit" file |
27554e90 JH |
14 | ) |
15 | ' | |
16 | ||
f964732c | 17 | test_expect_success 'interact with it via git svn' ' |
27554e90 JH |
18 | mkdir work.git && |
19 | ( | |
20 | cd work.git && | |
cff4243d | 21 | git svn init "$svnrepo" && |
27554e90 JH |
22 | git svn fetch && |
23 | ||
24 | echo modification >file && | |
25 | test_tick && | |
26 | git commit -a -m second && | |
27 | ||
28 | test_tick && | |
29 | git svn dcommit && | |
30 | ||
31 | echo "further modification" >file && | |
32 | test_tick && | |
33 | git commit -a -m third && | |
34 | ||
35 | test_tick && | |
36 | git svn --add-author-from dcommit && | |
37 | ||
38 | echo "yet further modification" >file && | |
39 | test_tick && | |
40 | git commit -a -m fourth && | |
41 | ||
42 | test_tick && | |
43 | git svn --add-author-from --use-log-author dcommit && | |
44 | ||
45 | git log && | |
46 | ||
47 | git show -s HEAD^^ >../actual.2 && | |
48 | git show -s HEAD^ >../actual.3 && | |
49 | git show -s HEAD >../actual.4 | |
50 | ||
51 | ) && | |
52 | ||
53 | # Make sure that --add-author-from without --use-log-author | |
54 | # did not affect the authorship information | |
55 | myself=$(grep "^Author: " actual.2) && | |
56 | unaffected=$(grep "^Author: " actual.3) && | |
57 | test "z$myself" = "z$unaffected" && | |
58 | ||
59 | # Make sure lack of --add-author-from did not add cruft | |
60 | ! grep "^ From: A U Thor " actual.2 && | |
61 | ||
62 | # Make sure --add-author-from added cruft | |
63 | grep "^ From: A U Thor " actual.3 && | |
64 | grep "^ From: A U Thor " actual.4 && | |
65 | ||
66 | # Make sure --add-author-from with --use-log-author affected | |
67 | # the authorship information | |
c8c6a2ec AP |
68 | grep "^Author: A U Thor " actual.4 && |
69 | ||
70 | # Make sure there are no commit messages with excess blank lines | |
71 | test $(grep "^ " actual.2 | wc -l) = 3 && | |
72 | test $(grep "^ " actual.3 | wc -l) = 5 && | |
73 | test $(grep "^ " actual.4 | wc -l) = 5 && | |
74 | ||
75 | # Make sure there are no svn commit messages with excess blank lines | |
76 | ( | |
77 | cd work.svn && | |
da083d68 | 78 | svn_cmd up && |
c8c6a2ec | 79 | |
da083d68 ER |
80 | test $(svn_cmd log -r2:2 | wc -l) = 5 && |
81 | test $(svn_cmd log -r4:4 | wc -l) = 7 | |
c8c6a2ec | 82 | ) |
27554e90 JH |
83 | ' |
84 | ||
85 | test_done |