t9138-git-svn-authors-prog.sh fixups
Several fixups of the t9138-git-svn-authors-prog.sh test script to follow current recommendations in t/README. - Fixed a Perl script with a full "#!/usr/bin/perl" shebang to use write_script() and $PERL_PATH as per t/README. - Placed svn-authors data setup inside a test_expect_success. - Fixed trailing quotes to use the same indentation throughout. Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeremiah Mahler committed
May 25, 2014 at 12:24 UTC
01730a3bb46806899e61d4d2d8d3677c5d64ffde
1 file changed
+17
-18
t/t9138-git-svn-authors-prog.sh
+17
-18
@@ -7,40 +7,39 @@ test_description='git svn authors prog tests'
7
8
. ./lib-git-svn.sh
9
10
-cat > svn-authors-prog <<'EOF'
11
-#!/usr/bin/perl
12
-$_ = shift;
13
-if (s/-sub$//) {
14
- print "$_ <$_\@sub.example.com>\n";
15
-}
16
-else {
17
- print "$_ <$_\@example.com>\n";
18
-}
10
+write_script svn-authors-prog "$PERL_PATH" <<-\EOF
11
+ $_ = shift;
12
+ if (s/-sub$//) {
13
+ print "$_ <$_\@sub.example.com>\n";
14
+ } else {
15
+ print "$_ <$_\@example.com>\n";
16
+ }
17
EOF
20
-chmod +x svn-authors-prog
18
22
-cat > svn-authors <<'EOF'
23
-ff = FFFFFFF FFFFFFF <fFf@other.example.com>
24
-EOF
19
+test_expect_success 'svn-authors setup' '
20
+ cat >svn-authors <<-\EOF
21
+ ff = FFFFFFF FFFFFFF <fFf@other.example.com>
22
+ EOF
23
+'
24
25
test_expect_success 'setup svnrepo' '
26
for i in aa bb cc-sub dd-sub ee-foo ff
27
do
28
svn mkdir -m $i --username $i "$svnrepo"/$i
29
done
31
- '
30
+'
31
32
test_expect_success 'import authors with prog and file' '
33
git svn clone --authors-prog=./svn-authors-prog \
34
--authors-file=svn-authors "$svnrepo" x
36
- '
35
+'
36
37
test_expect_success 'imported 6 revisions successfully' '
38
(
39
cd x
40
test "`git rev-list refs/remotes/git-svn | wc -l`" -eq 6
41
)
43
- '
42
+'
43
44
test_expect_success 'authors-prog ran correctly' '
45
(
@@ -56,7 +55,7 @@ test_expect_success 'authors-prog ran correctly' '
55
git rev-list -1 --pretty=raw refs/remotes/git-svn~5 | \
56
grep "^author aa <aa@example\.com> "
57
)
59
- '
58
+'
59
60
test_expect_success 'authors-file overrode authors-prog' '
61
(
@@ -64,7 +63,7 @@ test_expect_success 'authors-file overrode authors-prog' '
63
git rev-list -1 --pretty=raw refs/remotes/git-svn | \
64
grep "^author FFFFFFF FFFFFFF <fFf@other\.example\.com> "
65
)
67
- '
66
+'
67
68
git --git-dir=x/.git config --unset svn.authorsfile
69
git --git-dir=x/.git config --unset svn.authorsprog