(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'test tree diff when trees have duplicate entries'>)}
          spids: [4]
        )
      ]
      spids: [4]
    )
    (C {(.)} {(./test-lib.sh)})
    (FuncDef
      name: make_tree_entry
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(printf)} {(SQ <'%s %s\\0'>)} {(DQ ($ VSub_Number '$1'))} {(DQ ($ VSub_Number '$2'))})
                (C {(perl)} {(-e)} {(SQ <'print chr(hex($_)) for ($ARGV[0] =~ /../g)'>)} 
                  {(DQ ($ VSub_Number '$3'))}
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [31]
        )
      spids: [26 30]
    )
    (FuncDef
      name: make_tree
      body: 
        (BraceGroup
          children: [
            (Pipeline
              children: [
                (While
                  cond: [
                    (Sentence
                      child: (C {(test)} {($ VSub_Pound '$#')} {(-gt)} {(2)})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  body: 
                    (DoGroup
                      children: [
                        (C {(make_tree_entry)} {(DQ ($ VSub_Number '$1'))} {(DQ ($ VSub_Number '$2'))} 
                          {(DQ ($ VSub_Number '$3'))}
                        )
                        (Sentence
                          child: (C {(shift)})
                          terminator: <Op_Semi ';'>
                        )
                        (Sentence
                          child: (C {(shift)})
                          terminator: <Op_Semi ';'>
                        )
                        (C {(shift)})
                      ]
                      spids: [94 121]
                    )
                )
                (C {(git)} {(hash-object)} {(-w)} {(-t)} {(tree)} {(--stdin)})
              ]
              negated: False
            )
          ]
          spids: [80]
        )
      spids: [75 79]
    )
    (C {(test_expect_success)} {(SQ <'create trees with duplicate entries'>)} 
      {
        (SQ <'\n'> <'\tblob_one=$(echo one | git hash-object -w --stdin) &&\n'> 
          <'\tblob_two=$(echo two | git hash-object -w --stdin) &&\n'> <'\tinner_one_a=$(make_tree \\\n'> <'\t\t100644 inner $blob_one\n'> <'\t) &&\n'> 
          <'\tinner_one_b=$(make_tree \\\n'> <'\t\t100644 inner $blob_two \\\n'> <'\t\t100644 inner $blob_two \\\n'> 
          <'\t\t100644 inner $blob_two\n'> <'\t) &&\n'> <'\touter_one=$(make_tree \\\n'> <'\t\t040000 outer $inner_one_a \\\n'> 
          <'\t\t040000 outer $inner_one_b\n'> <'\t) &&\n'> <'\tinner_two=$(make_tree \\\n'> <'\t\t100644 inner $blob_one \\\n'> 
          <'\t\t100644 inner $blob_two \\\n'> <'\t\t100644 inner $blob_two \\\n'> <'\t\t100644 inner $blob_two\n'> <'\t) &&\n'> 
          <'\touter_two=$(make_tree \\\n'> <'\t\t040000 outer $inner_two\n'> <'\t) &&\n'> <'\tgit tag one $outer_one &&\n'> 
          <'\tgit tag two $outer_two\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'diff-tree between trees'>)} 
      {
        (SQ <'\n'> <'\t{\n'> <'\t\tprintf ":000000 100644 $_z40 $blob_two A\\touter/inner\\n" &&\n'> 
          <'\t\tprintf ":000000 100644 $_z40 $blob_two A\\touter/inner\\n" &&\n'> <'\t\tprintf ":000000 100644 $_z40 $blob_two A\\touter/inner\\n" &&\n'> 
          <'\t\tprintf ":100644 000000 $blob_two $_z40 D\\touter/inner\\n" &&\n'> <'\t\tprintf ":100644 000000 $blob_two $_z40 D\\touter/inner\\n" &&\n'> 
          <'\t\tprintf ":100644 000000 $blob_two $_z40 D\\touter/inner\\n"\n'> <'\t} >expect &&\n'> <'\tgit diff-tree -r --no-abbrev one two >actual &&\n'> 
          <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'diff-tree with renames'>)} 
      {
        (SQ <'\n'> <'\t# same expectation as above, since we disable rename detection\n'> 
          <'\tgit diff-tree -M -r --no-abbrev one two >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_done)})
  ]
)