(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'read-tree D/F conflict corner cases'>)}
          spids: [4]
        )
      ]
      spids: [4]
    )
    (C {(.)} {(./test-lib.sh)})
    (C {(.)} {(DQ ($ VSub_Name '$TEST_DIRECTORY')) (/lib-read-tree.sh)})
    (FuncDef
      name: maketree
      body: 
        (BraceGroup
          children: [
            (Subshell
              child: 
                (AndOr
                  children: [
                    (C {(rm)} {(-f)} {(.git/index)} {(.git/index.lock)})
                    (AndOr
                      children: [
                        (C {(git)} {(clean)} {(-d)} {(-f)} {(-f)} {(-q)} {(-x)})
                        (AndOr
                          children: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:name)
                                  op: Equal
                                  rhs: {(DQ ($ VSub_Number '$1'))}
                                  spids: [61]
                                )
                              ]
                              spids: [61]
                            )
                            (AndOr
                              children: [
                                (C {(shift)})
                                (AndOr
                                  children: [
                                    (ForEach
                                      iter_name: it
                                      do_arg_iter: True
                                      body: 
                                        (DoGroup
                                          children: [
                                            (AndOr
                                              children: [
                                                (Assignment
                                                  keyword: Assign_None
                                                  pairs: [
                                                    (assign_pair
                                                      lhs: (LhsName name:path)
                                                      op: Equal
                                                      rhs: 
                                                        {
                                                          (CommandSubPart
                                                            command_list: 
                                                              (CommandList
                                                                children: [
                                                                  (C {(expr)} {(DQ ($ VSub_Name '$it'))} 
                                                                    {(Lit_Other ':')} {(SQ <'\\([^:]*\\)'>)}
                                                                  )
                                                                ]
                                                              )
                                                            left_token: <Left_CommandSub '$('>
                                                            spids: [83 95]
                                                          )
                                                        }
                                                      spids: [82]
                                                    )
                                                  ]
                                                  spids: [82]
                                                )
                                                (AndOr
                                                  children: [
                                                    (C {(mkdir)} {(-p)} 
                                                      {
                                                        (CommandSubPart
                                                          command_list: 
                                                            (CommandList
                                                              children: [
                                                                (C {(dirname)} 
                                                                  {(DQ ($ VSub_Name '$path'))}
                                                                )
                                                              ]
                                                            )
                                                          left_token: <Left_CommandSub '$('>
                                                          spids: [104 110]
                                                        )
                                                      }
                                                    )
                                                    (AndOr
                                                      children: [
                                                        (SimpleCommand
                                                          words: [{(echo)} {(DQ ($ VSub_Name '$it'))}]
                                                          redirects: [
                                                            (Redir
                                                              op_id: Redir_Great
                                                              fd: 16777215
                                                              arg_word: {(DQ ($ VSub_Name '$path'))}
                                                              spids: [121]
                                                            )
                                                          ]
                                                        )
                                                        (AndOr
                                                          children: [
                                                            (C {(git)} {(update-index)} {(--add)} 
                                                              {(DQ ($ VSub_Name '$path'))}
                                                            )
                                                            (C {(exit)})
                                                          ]
                                                          op_id: Op_DPipe
                                                        )
                                                      ]
                                                      op_id: Op_DAmp
                                                    )
                                                  ]
                                                  op_id: Op_DAmp
                                                )
                                              ]
                                              op_id: Op_DAmp
                                            )
                                          ]
                                          spids: [79 144]
                                        )
                                      spids: [16777215 16777215]
                                    )
                                    (C {(git)} {(tag)} {(DQ ($ VSub_Name '$name'))} 
                                      {
                                        (CommandSubPart
                                          command_list: 
                                            (CommandList
                                              children: [(C {(git)} {(write-tree)})]
                                            )
                                          left_token: <Left_CommandSub '$('>
                                          spids: [157 161]
                                        )
                                      }
                                    )
                                  ]
                                  op_id: Op_DAmp
                                )
                              ]
                              op_id: Op_DAmp
                            )
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  op_id: Op_DAmp
                )
              spids: [30 164]
            )
          ]
          spids: [27]
        )
      spids: [22 26]
    )
    (FuncDef
      name: settree
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(rm)} {(-f)} {(.git/index)} {(.git/index.lock)})
                (AndOr
                  children: [
                    (C {(git)} {(clean)} {(-d)} {(-f)} {(-f)} {(-q)} {(-x)})
                    (AndOr
                      children: [
                        (C {(git)} {(read-tree)} {(DQ ($ VSub_Number '$1'))})
                        (AndOr
                          children: [
                            (C {(git)} {(checkout-index)} {(-f)} {(-q)} {(-u)} {(-a)})
                            (C {(git)} {(update-index)} {(--refresh)})
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [174]
        )
      spids: [169 173]
    )
    (FuncDef
      name: checkindex
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(git)} {(ls-files)} {(-s)})
                    (SimpleCommand
                      words: [
                        {(sed)}
                        {
                          (DQ ('s|^[0-7][0-7]* ') ($ VSub_Name '$_x40') (' ') (Lit_Other '\\') ('([0-3]') 
                            (Lit_Other '\\') (')\t|') (Lit_Other '\\') ('1 |')
                          )
                        }
                      ]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(current)}
                          spids: [271]
                        )
                      ]
                    )
                  ]
                  negated: False
                )
                (AndOr
                  children: [
                    (SimpleCommand
                      words: [{(cat)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(expect)}
                          spids: [279]
                        )
                      ]
                    )
                    (C {(test_cmp)} {(expect)} {(current)})
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [245]
        )
      spids: [240 244]
    )
    (C {(test_expect_success)} {(setup)} 
      {
        (SQ <'\n'> <'\tmaketree O-000 a/b-2/c/d a/b/c/d a/x &&\n'> 
          <'\tmaketree A-000 a/b-2/c/d a/b/c/d a/x &&\n'> <'\tmaketree A-001 a/b-2/c/d a/b/c/d a/b/c/e a/x &&\n'> 
          <'\tmaketree B-000 a/b-2/c/d a/b     a/x &&\n'> <'\n'> <'\tmaketree O-010 t-0     t/1  t/2 t=3 &&\n'> <'\tmaketree A-010 t-0 t            t=3 &&\n'> 
          <'\tmaketree B-010         t/1:     t=3: &&\n'> <'\n'> <'\tmaketree O-020 ds/dma/ioat.c ds/dma/ioat_dca.c &&\n'> 
          <'\tmaketree A-020 ds/dma/ioat/Makefile ds/dma/ioat/registers.h &&\n'> <'\t:\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'3-way (1)'>)} 
      {
        (SQ <'\n'> <'\tsettree A-000 &&\n'> <'\tread_tree_u_must_succeed -m -u O-000 A-000 B-000 &&\n'> 
          <'\tcheckindex <<-EOF\n'> <'\t3 a/b\n'> <'\t0 a/b-2/c/d\n'> <'\t1 a/b/c/d\n'> <'\t2 a/b/c/d\n'> <'\t0 a/x\n'> <'\tEOF\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'3-way (2)'>)} 
      {
        (SQ <'\n'> <'\tsettree A-001 &&\n'> <'\tread_tree_u_must_succeed -m -u O-000 A-001 B-000 &&\n'> 
          <'\tcheckindex <<-EOF\n'> <'\t3 a/b\n'> <'\t0 a/b-2/c/d\n'> <'\t1 a/b/c/d\n'> <'\t2 a/b/c/d\n'> <'\t2 a/b/c/e\n'> <'\t0 a/x\n'> 
          <'\tEOF\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'3-way (3)'>)} 
      {
        (SQ <'\n'> <'\tsettree A-010 &&\n'> <'\tread_tree_u_must_succeed -m -u O-010 A-010 B-010 &&\n'> 
          <'\tcheckindex <<-EOF\n'> <'\t2 t\n'> <'\t1 t-0\n'> <'\t2 t-0\n'> <'\t1 t/1\n'> <'\t3 t/1\n'> <'\t1 t/2\n'> <'\t0 t=3\n'> <'\tEOF\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'2-way (1)'>)} 
      {
        (SQ <'\n'> <'\tsettree O-020 &&\n'> <'\tread_tree_u_must_succeed -m -u O-020 A-020 &&\n'> 
          <'\tcheckindex <<-EOF\n'> <'\t0 ds/dma/ioat/Makefile\n'> <'\t0 ds/dma/ioat/registers.h\n'> <'\tEOF\n'>
        )
      }
    )
    (C {(test_done)})
  ]
)