(command.CommandList
  children: [
    (command.ShAssignment
      left: <Id.Lit_VarLike 'test_description='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'test_description='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description)
          op: assign_op.Equal
          rhs: 
            {
              (SQ <'gitweb as standalone script (parsing script output).\n'> <'\n'> 
                <'This test runs gitweb (git web interface) as a CGI script from the\n'> <'commandline, and checks that it produces the correct output, either\n'> 
                <'in the HTTP header or the actual script output.'>
              )
            }
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./gitweb-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<gitweb_config.perl>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'> ch:E) <OF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'\n'>
                <'$known_snapshot_formats{\'tar\'} = {\n'>
                <'\t\'display\' => \'tar\',\n'>
                <'\t\'type\' => \'application/x-tar\',\n'>
                <'\t\'suffix\' => \'.tar\',\n'>
                <'\t\'format\' => \'tar\',\n'>
                <'};\n'>
                <'\n'>
                <'$feature{\'snapshot\'}{\'default\'} = [\'tar\'];\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.ShFunction
      name_tok: <check_snapshot>
      name: check_snapshot
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'basename='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'basename='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'basename='> name:basename)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 1)}
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'prefix='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'prefix='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'prefix='> name:prefix)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (BracedVarSub
                        left: <Id.Left_DollarBrace '${'>
                        token: <Id.VSub_Number 2>
                        var_name: 2
                        suffix_op: 
                          (suffix_op.Unary
                            op: <Id.VTest_ColonHyphen _>
                            arg_word: {(DQ ($ Id.VSub_Number 1))}
                          )
                        right: <Id.Right_DollarBrace '}'>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <echo>
              more_env: []
              words: [{<echo>} {(DQ <'basename='> ($ Id.VSub_DollarName basename))}]
              redirects: []
              do_fork: T
            )
            (command.AndOr
              children: [
                (command.Simple
                  blame_tok: <grep>
                  more_env: []
                  words: [
                    {<grep>}
                    {(DQ <'filename=.*'> ($ Id.VSub_DollarName basename) <.tar>)}
                    {<gitweb.headers>}
                  ]
                  redirects: [
                    (Redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {<'/dev/null'>}
                    )
                    (Redir
                      op: <Id.Redir_GreatAnd '2>&'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<1>}
                    )
                  ]
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <Id.Left_DoubleQuote '"'>
                  more_env: []
                  words: [{(DQ ($ Id.VSub_DollarName TAR))} {<tf>} {<gitweb.body>}]
                  redirects: [(Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<file_list>})]
                  do_fork: T
                )
                (command.Pipeline
                  negated: <Id.KW_Bang '!'>
                  children: [
                    (command.Simple
                      blame_tok: <grep>
                      more_env: []
                      words: [
                        {<grep>}
                        {<-v>}
                        {<-e>}
                        {(DQ <'^'> ($ Id.VSub_DollarName prefix) <Id.Lit_Dollar '$'>)}
                        {<-e>}
                        {(DQ <'^'> ($ Id.VSub_DollarName prefix) <'/'>)}
                        {<-e>}
                        {(DQ <'^pax_global_header'> <Id.Lit_Dollar '$'>)}
                        {<file_list>}
                      ]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  ops: []
                )
              ]
              ops: [<Id.Op_DAmp _> <Id.Op_DAmp _>]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<setup>}
        {
          (SQ <'\n'> <'\ttest_commit first foo &&\n'> <'\tgit branch xx/test &&\n'> 
            <'\tFULL_ID=$(git rev-parse --verify HEAD) &&\n'> <'\tSHORT_ID=$(git rev-parse --verify --short=7 HEAD)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_debug>
      more_env: []
      words: [
        {<test_debug>}
        {(SQ <'\n'> <'\techo "FULL_ID  = $FULL_ID"\n'> <'\techo "SHORT_ID = $SHORT_ID"\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'snapshot: full sha1'>)}
        {
          (SQ <'\n'> <'\tgitweb_run "p=.git;a=snapshot;h=$FULL_ID;sf=tar" &&\n'> 
            <'\tcheck_snapshot ".git-$SHORT_ID"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_debug>
      more_env: []
      words: [{<test_debug>} {(SQ <'cat gitweb.headers && cat file_list'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'snapshot: shortened sha1'>)}
        {
          (SQ <'\n'> <'\tgitweb_run "p=.git;a=snapshot;h=$SHORT_ID;sf=tar" &&\n'> 
            <'\tcheck_snapshot ".git-$SHORT_ID"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_debug>
      more_env: []
      words: [{<test_debug>} {(SQ <'cat gitweb.headers && cat file_list'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'snapshot: almost full sha1'>)}
        {
          (SQ <'\n'> <'\tID=$(git rev-parse --short=30 HEAD) &&\n'> 
            <'\tgitweb_run "p=.git;a=snapshot;h=$ID;sf=tar" &&\n'> <'\tcheck_snapshot ".git-$SHORT_ID"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_debug>
      more_env: []
      words: [{<test_debug>} {(SQ <'cat gitweb.headers && cat file_list'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'snapshot: HEAD'>)}
        {
          (SQ <'\n'> <'\tgitweb_run "p=.git;a=snapshot;h=HEAD;sf=tar" &&\n'> 
            <'\tcheck_snapshot ".git-HEAD-$SHORT_ID"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_debug>
      more_env: []
      words: [{<test_debug>} {(SQ <'cat gitweb.headers && cat file_list'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'snapshot: short branch name (master)'>)}
        {
          (SQ <'\n'> <'\tgitweb_run "p=.git;a=snapshot;h=master;sf=tar" &&\n'> 
            <'\tID=$(git rev-parse --verify --short=7 master) &&\n'> <'\tcheck_snapshot ".git-master-$ID"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_debug>
      more_env: []
      words: [{<test_debug>} {(SQ <'cat gitweb.headers && cat file_list'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'snapshot: short tag name (first)'>)}
        {
          (SQ <'\n'> <'\tgitweb_run "p=.git;a=snapshot;h=first;sf=tar" &&\n'> 
            <'\tID=$(git rev-parse --verify --short=7 first) &&\n'> <'\tcheck_snapshot ".git-first-$ID"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_debug>
      more_env: []
      words: [{<test_debug>} {(SQ <'cat gitweb.headers && cat file_list'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'snapshot: full branch name (refs/heads/master)'>)}
        {
          (SQ <'\n'> <'\tgitweb_run "p=.git;a=snapshot;h=refs/heads/master;sf=tar" &&\n'> 
            <'\tID=$(git rev-parse --verify --short=7 master) &&\n'> <'\tcheck_snapshot ".git-master-$ID"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_debug>
      more_env: []
      words: [{<test_debug>} {(SQ <'cat gitweb.headers && cat file_list'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'snapshot: full tag name (refs/tags/first)'>)}
        {
          (SQ <'\n'> <'\tgitweb_run "p=.git;a=snapshot;h=refs/tags/first;sf=tar" &&\n'> 
            <'\tcheck_snapshot ".git-first"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_debug>
      more_env: []
      words: [{<test_debug>} {(SQ <'cat gitweb.headers && cat file_list'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'snapshot: hierarchical branch name (xx/test)'>)}
        {
          (SQ <'\n'> <'\tgitweb_run "p=.git;a=snapshot;h=xx/test;sf=tar" &&\n'> 
            <'\t! grep "filename=.*/" gitweb.headers\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_debug>
      more_env: []
      words: [{<test_debug>} {(SQ <'cat gitweb.headers'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'forks: setup'>)}
        {
          (SQ <'\n'> <'\tgit init --bare foo.git &&\n'> <'\techo file > file &&\n'> 
            <'\tgit --git-dir=foo.git --work-tree=. add file &&\n'> <'\tgit --git-dir=foo.git --work-tree=. commit -m "Initial commit" &&\n'> 
            <'\techo "foo" > foo.git/description &&\n'> <'\tgit clone --bare foo.git foo.bar.git &&\n'> <'\techo "foo.bar" > foo.bar.git/description &&\n'> 
            <'\tgit clone --bare foo.git foo_baz.git &&\n'> <'\techo "foo_baz" > foo_baz.git/description &&\n'> <'\trm -fr   foo &&\n'> <'\tmkdir -p foo &&\n'> 
            <'\t(\n'> <'\t\tcd foo &&\n'> <'\t\tgit clone --shared --bare ../foo.git foo-forked.git &&\n'> 
            <'\t\techo "fork of foo" > foo-forked.git/description\n'> <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'forks: not skipped unless "forks" feature enabled'>)}
        {
          (SQ <'\n'> <'\tgitweb_run "a=project_list" &&\n'> 
            <'\tgrep -q ">\\\\.git<"               gitweb.body &&\n'> <'\tgrep -q ">foo\\\\.git<"            gitweb.body &&\n'> 
            <'\tgrep -q ">foo_baz\\\\.git<"        gitweb.body &&\n'> <'\tgrep -q ">foo\\\\.bar\\\\.git<"      gitweb.body &&\n'> 
            <'\tgrep -q ">foo_baz\\\\.git<"        gitweb.body &&\n'> <'\tgrep -q ">foo/foo-forked\\\\.git<" gitweb.body &&\n'> 
            <'\tgrep -q ">fork of .*<"           gitweb.body\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'enable forks feature'>)}
        {
          (SQ <'\n'> <'\tcat >>gitweb_config.perl <<-\\EOF\n'> 
            <'\t$feature{"forks"}{"default"} = [1];\n'> <'\tEOF\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'forks: forks skipped if "forks" feature enabled'>)}
        {
          (SQ <'\n'> <'\tgitweb_run "a=project_list" &&\n'> 
            <'\tgrep -q ">\\\\.git<"               gitweb.body &&\n'> <'\tgrep -q ">foo\\\\.git<"            gitweb.body &&\n'> 
            <'\tgrep -q ">foo_baz\\\\.git<"        gitweb.body &&\n'> <'\tgrep -q ">foo\\\\.bar\\\\.git<"      gitweb.body &&\n'> 
            <'\tgrep -q ">foo_baz\\\\.git<"        gitweb.body &&\n'> <'\tgrep -v ">foo/foo-forked\\\\.git<" gitweb.body &&\n'> 
            <'\tgrep -v ">fork of .*<"           gitweb.body\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'forks: "forks" action for forked repository'>)}
        {
          (SQ <'\n'> <'\tgitweb_run "p=foo.git;a=forks" &&\n'> 
            <'\tgrep -q ">foo/foo-forked\\\\.git<" gitweb.body &&\n'> <'\tgrep -q ">fork of foo<"          gitweb.body\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'forks: can access forked repository'>)}
        {
          (SQ <'\n'> <'\tgitweb_run "p=foo/foo-forked.git;a=summary" &&\n'> 
            <'\tgrep -q "200 OK"        gitweb.headers &&\n'> <'\tgrep -q ">fork of foo<" gitweb.body\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'forks: project_index lists all projects (incl. forks)'>)}
        {
          (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\t.git\n'> <'\tfoo.bar.git\n'> <'\tfoo.git\n'> 
            <'\tfoo/foo-forked.git\n'> <'\tfoo_baz.git\n'> <'\tEOF\n'> <'\tgitweb_run "a=project_index" &&\n'> 
            <'\tsed -e "s/ .*//" <gitweb.body | sort >actual &&\n'> <'\ttest_cmp expected actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.ShFunction
      name_tok: <xss>
      name: xss
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.AndOr
              children: [
                (command.Simple
                  blame_tok: <echo>
                  more_env: []
                  words: [{<echo>} {(DQ <'Checking '> ($ Id.VSub_Number 1) <...>)}]
                  redirects: [(Redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <gitweb_run>
                  more_env: []
                  words: [{<gitweb_run>} {(DQ ($ Id.VSub_Number 1))}]
                  redirects: []
                  do_fork: T
                )
                (command.If
                  if_kw: <Id.KW_If if>
                  arms: [
                    (IfArm
                      keyword: <Id.KW_If if>
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.Sentence
                              child: 
                                (command.Simple
                                  blame_tok: <grep>
                                  more_env: []
                                  words: [{<grep>} {(DQ ($ Id.VSub_DollarName TAG))} {<gitweb.body>}]
                                  redirects: []
                                  do_fork: T
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                        )
                      then_kw: <Id.KW_Then then>
                      action: [
                        (command.Simple
                          blame_tok: <echo>
                          more_env: []
                          words: [
                            {<echo>}
                            {
                              (DQ <'xss: '> ($ Id.VSub_DollarName TAG) 
                                <' should have been quoted in output'>
                              )
                            }
                          ]
                          redirects: [
                            (Redir
                              op: <Id.Redir_GreatAnd '>&'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {<2>}
                            )
                          ]
                          do_fork: T
                        )
                        (command.ControlFlow
                          keyword: <Id.ControlFlow_Return return>
                          arg_word: {<1>}
                        )
                      ]
                      spids: [535 546]
                    )
                  ]
                  else_action: []
                  fi_kw: <Id.KW_Fi fi>
                  redirects: []
                )
              ]
              ops: [<Id.Op_DAmp _> <Id.Op_DAmp _>]
            )
            (command.ControlFlow keyword:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'xss checks'>)}
        {
          (SQ <'\n'> <'\tTAG="<magic-xss-tag>" &&\n'> <'\txss "a=rss&p=$TAG" &&\n'> 
            <'\txss "a=rss&p=foo.git&f=$TAG"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)