(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ <'git svn authors prog tests'>)} spids: [13] ) ] ) (C {<.>} {<'./lib-git-svn.sh'>}) (command.Simple words: [{<write_script>} {<svn-authors-prog>} {(DQ ($ Id.VSub_DollarName '$PERL_PATH'))}] redirects: [ (redir op: <Id.Redir_DLessDash '<<-'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'>) <OF>} here_end_span_id: 42 stdin_parts: [ <'$_ = shift;\n'> <'if (s/-sub$//) {\n'> <'print "$_ <$_\\@sub.example.com>\\n";\n'> <'} else {\n'> <'print "$_ <$_\\@example.com>\\n";\n'> <'}\n'> ] ) ) ] do_fork: T ) (C {<test_expect_success>} {(SQ <'svn-authors setup'>)} { (SQ <'\n'> <'\tcat >svn-authors <<-\\EOF\n'> <'\tff = FFFFFFF FFFFFFF <fFf@other.example.com>\n'> <'\tEOF\n'> ) } ) (C {<test_expect_success>} {(SQ <'setup svnrepo'>)} { (SQ <'\n'> <'\tfor i in aa bb cc-sub dd-sub ee-foo ff\n'> <'\tdo\n'> <'\t\tsvn mkdir -m $i --username $i "$svnrepo"/$i\n'> <'\tdone\n'> ) } ) (C {<test_expect_success>} {(SQ <'import authors with prog and file'>)} { (SQ <'\n'> <'\tgit svn clone --authors-prog=./svn-authors-prog \\\n'> <'\t --authors-file=svn-authors "$svnrepo" x\n'> ) } ) (C {<test_expect_success>} {(SQ <'imported 6 revisions successfully'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd x\n'> <'\t\ttest "$(git rev-list refs/remotes/git-svn | wc -l)" -eq 6\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'authors-prog ran correctly'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd x\n'> <'\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n'> <'\t\t grep "^author ee-foo <ee-foo@example\\.com> " &&\n'> <'\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~2 | \\\n'> <'\t\t grep "^author dd <dd@sub\\.example\\.com> " &&\n'> <'\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~3 | \\\n'> <'\t\t grep "^author cc <cc@sub\\.example\\.com> " &&\n'> <'\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~4 | \\\n'> <'\t\t grep "^author bb <bb@example\\.com> " &&\n'> <'\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~5 | \\\n'> <'\t\t grep "^author aa <aa@example\\.com> "\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'authors-file overrode authors-prog'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd x\n'> <'\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n'> <'\t\t grep "^author FFFFFFF FFFFFFF <fFf@other\\.example\\.com> "\n'> <'\t)\n'> ) } ) (C {<git>} {<--git-dir> <Id.Lit_Equals '='> <'x/.git'>} {<config>} {<--unset>} {<svn.authorsfile>}) (C {<git>} {<--git-dir> <Id.Lit_Equals '='> <'x/.git'>} {<config>} {<--unset>} {<svn.authorsprog>}) (C {<test_expect_success>} {(SQ <'authors-prog handled special characters in username'>)} { (SQ <'\n'> <'\tsvn mkdir -m bad --username "xyz; touch evil" "$svnrepo"/bad &&\n'> <'\t(\n'> <'\t\tcd x &&\n'> <'\t\tgit svn --authors-prog=../svn-authors-prog fetch &&\n'> <'\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn |\n'> <'\t\tgrep "^author xyz; touch evil <xyz; touch evil@example\\.com> " &&\n'> <'\t\t! test -f evil\n'> <'\t)\n'> ) } ) (C {<test_done>}) ] )