(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(SQ <"git svn init/clone tests">)}
          spids: [13]
        )
      ]
      spids: [13]
    )
    (C {(.)} {(./lib-git-svn.sh)})
    (C {(set)} {(-e)})
    (C {(rm)} {(-r)} {(.git)})
    (C {(mkdir)} {(tmp)})
    (C {(cd)} {(tmp)})
    (C {(test_expect_success)} {(SQ <"setup svnrepo">)} 
      {
        (SQ <"\n"> <"\tmkdir project project/trunk project/branches project/tags &&\n"> 
          <"\techo foo > project/trunk/foo &&\n"> <"\tsvn_cmd import -m \"$test_description\" project \"$svnrepo\"/project &&\n"> <"\trm -rf project\n"> 
          <"\t">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"basic clone">)} 
      {
        (SQ <"\n"> <"\ttest ! -d trunk &&\n"> <"\tgit svn clone \"$svnrepo\"/project/trunk &&\n"> 
          <"\ttest -d trunk/.git/svn &&\n"> <"\ttest -e trunk/foo &&\n"> <"\trm -rf trunk\n"> <"\t">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"clone to target directory">)} 
      {
        (SQ <"\n"> <"\ttest ! -d target &&\n"> 
          <"\tgit svn clone \"$svnrepo\"/project/trunk target &&\n"> <"\ttest -d target/.git/svn &&\n"> <"\ttest -e target/foo &&\n"> <"\trm -rf target\n"> <"\t">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"clone with --stdlayout">)} 
      {
        (SQ <"\n"> <"\ttest ! -d project &&\n"> <"\tgit svn clone -s \"$svnrepo\"/project &&\n"> 
          <"\ttest -d project/.git/svn &&\n"> <"\ttest -e project/foo &&\n"> <"\trm -rf project\n"> <"\t">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"clone to target directory with --stdlayout">)} 
      {
        (SQ <"\n"> <"\ttest ! -d target &&\n"> <"\tgit svn clone -s \"$svnrepo\"/project target &&\n"> 
          <"\ttest -d target/.git/svn &&\n"> <"\ttest -e target/foo &&\n"> <"\trm -rf target\n"> <"\t">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"init without -s/-T/-b/-t does not warn">)} 
      {
        (SQ <"\n"> <"\ttest ! -d trunk &&\n"> 
          <"\tgit svn init \"$svnrepo\"/project/trunk trunk 2>warning &&\n"> <"\ttest_must_fail grep -q prefix warning &&\n"> <"\trm -rf trunk &&\n"> <"\trm -f warning\n"> <"\t">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"clone without -s/-T/-b/-t does not warn">)} 
      {
        (SQ <"\n"> <"\ttest ! -d trunk &&\n"> 
          <"\tgit svn clone \"$svnrepo\"/project/trunk 2>warning &&\n"> <"\ttest_must_fail grep -q prefix warning &&\n"> <"\trm -rf trunk &&\n"> <"\trm -f warning\n"> <"\t">
        )
      }
    )
    (FuncDef
      name: test_svn_configured_prefix
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:prefix)
                      op: Equal
                      rhs: {($ VSub_Number "$1")}
                      spids: [172]
                    )
                  ]
                  spids: [172]
                )
                (AndOr
                  children: [
                    (SimpleCommand
                      words: [{(cat)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: -1
                          arg_word: {(expect)}
                          spids: [180]
                        )
                        (HereDoc
                          op_id: Redir_DLess
                          fd: -1
                          body: 
                            {
                              (DQ ("project/trunk:refs/remotes/") (${ VSub_Name prefix) ("trunk\n") 
                                ("project/branches/*:refs/remotes/") (${ VSub_Name prefix) ("*\n") ("project/tags/*:refs/remotes/") (${ VSub_Name prefix) ("tags/*\n")
                              )
                            }
                          do_expansion: True
                          here_end: EOF
                          was_filled: True
                          spids: [183]
                        )
                      ]
                    )
                    (AndOr
                      children: [
                        (C {(test)} {(KW_Bang "!")} {(-f)} {(actual)})
                        (AndOr
                          children: [
                            (SimpleCommand
                              words: [
                                {(git)}
                                {(--git-dir) (Lit_Other "=") (project/.git)}
                                {(config)}
                                {(svn-remote.svn.fetch)}
                              ]
                              redirects: [
                                (Redir
                                  op_id: Redir_DGreat
                                  fd: -1
                                  arg_word: {(actual)}
                                  spids: [225]
                                )
                              ]
                            )
                            (AndOr
                              children: [
                                (SimpleCommand
                                  words: [
                                    {(git)}
                                    {(--git-dir) (Lit_Other "=") (project/.git)}
                                    {(config)}
                                    {(svn-remote.svn.branches)}
                                  ]
                                  redirects: [
                                    (Redir
                                      op_id: Redir_DGreat
                                      fd: -1
                                      arg_word: {(actual)}
                                      spids: [241]
                                    )
                                  ]
                                )
                                (AndOr
                                  children: [
                                    (SimpleCommand
                                      words: [
                                        {(git)}
                                        {(--git-dir) (Lit_Other "=") (project/.git)}
                                        {(config)}
                                        {(svn-remote.svn.tags)}
                                      ]
                                      redirects: [
                                        (Redir
                                          op_id: Redir_DGreat
                                          fd: -1
                                          arg_word: {(actual)}
                                          spids: [257]
                                        )
                                      ]
                                    )
                                    (AndOr
                                      children: [
                                        (C {(test_cmp)} {(expect)} {(actual)})
                                        (C {(rm)} {(-f)} {(expect)} {(actual)})
                                      ]
                                      op_id: Op_DAmp
                                    )
                                  ]
                                  op_id: Op_DAmp
                                )
                              ]
                              op_id: Op_DAmp
                            )
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [169]
        )
      spids: [164 168]
    )
    (C {(test_expect_success)} {(SQ <"init with -s/-T/-b/-t assumes --prefix=origin/">)} 
      {
        (SQ <"\n"> <"\ttest ! -d project &&\n"> 
          <"\tgit svn init -s \"$svnrepo\"/project project 2>warning &&\n"> <"\ttest_must_fail grep -q prefix warning &&\n"> <"\ttest_svn_configured_prefix \"origin/\" &&\n"> 
          <"\trm -rf project &&\n"> <"\trm -f warning\n"> <"\t">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"clone with -s/-T/-b/-t assumes --prefix=origin/">)} 
      {
        (SQ <"\n"> <"\ttest ! -d project &&\n"> 
          <"\tgit svn clone -s \"$svnrepo\"/project 2>warning &&\n"> <"\ttest_must_fail grep -q prefix warning &&\n"> <"\ttest_svn_configured_prefix \"origin/\" &&\n"> 
          <"\trm -rf project &&\n"> <"\trm -f warning\n"> <"\t">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"init with -s/-T/-b/-t and --prefix \"\" still works">)} 
      {
        (SQ <"\n"> <"\ttest ! -d project &&\n"> 
          <"\tgit svn init -s \"$svnrepo\"/project project --prefix \"\" 2>warning &&\n"> <"\ttest_must_fail grep -q prefix warning &&\n"> <"\ttest_svn_configured_prefix \"\" &&\n"> 
          <"\trm -rf project &&\n"> <"\trm -f warning\n"> <"\t">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"clone with -s/-T/-b/-t and --prefix \"\" still works">)} 
      {
        (SQ <"\n"> <"\ttest ! -d project &&\n"> 
          <"\tgit svn clone -s \"$svnrepo\"/project --prefix \"\" 2>warning &&\n"> <"\ttest_must_fail grep -q prefix warning &&\n"> <"\ttest_svn_configured_prefix \"\" &&\n"> 
          <"\trm -rf project &&\n"> <"\trm -f warning\n"> <"\t">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"init with -T as a full url works">)} 
      {
        (SQ <"\n"> <"\ttest ! -d project &&\n"> 
          <"\tgit svn init -T \"$svnrepo\"/project/trunk project &&\n"> <"\trm -rf project\n"> <"\t">
        )
      }
    )
    (C {(test_done)})
  ]
)