(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'git merge-tree'>)}
          spids: [13]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (C {<test_expect_success>} {<setup>} 
      {(SQ <'\n'> <'\ttest_commit "initial" "initial-file" "initial"\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'file add A, !B'>)} 
      {
        (SQ <'\n'> <'\tcat >expected <<\\EXPECTED &&\n'> <'added in remote\n'> 
          <'  their  100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE\n'> <'@@ -0,0 +1 @@\n'> <'+AAA\n'> <'EXPECTED\n'> <'\n'> <'\tgit reset --hard initial &&\n'> 
          <'\ttest_commit "add-a-not-b" "ONE" "AAA" &&\n'> <'\tgit merge-tree initial initial add-a-not-b >actual &&\n'> <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'file add !A, B'>)} 
      {
        (SQ <'\n'> <'\tcat >expected <<\\EXPECTED &&\n'> <'EXPECTED\n'> <'\n'> 
          <'\tgit reset --hard initial &&\n'> <'\ttest_commit "add-not-a-b" "ONE" "AAA" &&\n'> 
          <'\tgit merge-tree initial add-not-a-b initial >actual &&\n'> <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'file add A, B (same)'>)} 
      {
        (SQ <'\n'> <'\tcat >expected <<\\EXPECTED &&\n'> <'EXPECTED\n'> <'\n'> 
          <'\tgit reset --hard initial &&\n'> <'\ttest_commit "add-a-b-same-A" "ONE" "AAA" &&\n'> <'\tgit reset --hard initial &&\n'> 
          <'\ttest_commit "add-a-b-same-B" "ONE" "AAA" &&\n'> <'\tgit merge-tree initial add-a-b-same-A add-a-b-same-B >actual &&\n'> 
          <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'file add A, B (different)'>)} 
      {
        (SQ <'\n'> <'\tcat >expected <<\\EXPECTED &&\n'> <'added in both\n'> 
          <'  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE\n'> <'  their  100644 ba629238ca89489f2b350e196ca445e09d8bb834 ONE\n'> <'@@ -1 +1,5 @@\n'> 
          <'+<<<<<<< .our\n'> <' AAA\n'> <'+=======\n'> <'+BBB\n'> <'+>>>>>>> .their\n'> <'EXPECTED\n'> <'\n'> 
          <'\tgit reset --hard initial &&\n'> <'\ttest_commit "add-a-b-diff-A" "ONE" "AAA" &&\n'> <'\tgit reset --hard initial &&\n'> 
          <'\ttest_commit "add-a-b-diff-B" "ONE" "BBB" &&\n'> <'\tgit merge-tree initial add-a-b-diff-A add-a-b-diff-B >actual &&\n'> 
          <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'file change A, !B'>)} 
      {
        (SQ <'\n'> <'\tcat >expected <<\\EXPECTED &&\n'> <'EXPECTED\n'> <'\n'> 
          <'\tgit reset --hard initial &&\n'> <'\ttest_commit "change-a-not-b" "initial-file" "BBB" &&\n'> 
          <'\tgit merge-tree initial change-a-not-b initial >actual &&\n'> <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'file change !A, B'>)} 
      {
        (SQ <'\n'> <'\tcat >expected <<\\EXPECTED &&\n'> <'merged\n'> 
          <'  result 100644 ba629238ca89489f2b350e196ca445e09d8bb834 initial-file\n'> <'  our    100644 e79c5e8f964493290a409888d5413a737e8e5dd5 initial-file\n'> <'@@ -1 +1 @@\n'> 
          <'-initial\n'> <'+BBB\n'> <'EXPECTED\n'> <'\n'> <'\tgit reset --hard initial &&\n'> 
          <'\ttest_commit "change-not-a-b" "initial-file" "BBB" &&\n'> <'\tgit merge-tree initial initial change-not-a-b >actual &&\n'> <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'file change A, B (same)'>)} 
      {
        (SQ <'\n'> <'\tcat >expected <<\\EXPECTED &&\n'> <'EXPECTED\n'> <'\n'> 
          <'\tgit reset --hard initial &&\n'> <'\ttest_commit "change-a-b-same-A" "initial-file" "AAA" &&\n'> <'\tgit reset --hard initial &&\n'> 
          <'\ttest_commit "change-a-b-same-B" "initial-file" "AAA" &&\n'> <'\tgit merge-tree initial change-a-b-same-A change-a-b-same-B >actual &&\n'> 
          <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'file change A, B (different)'>)} 
      {
        (SQ <'\n'> <'\tcat >expected <<\\EXPECTED &&\n'> <'changed in both\n'> 
          <'  base   100644 e79c5e8f964493290a409888d5413a737e8e5dd5 initial-file\n'> <'  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d initial-file\n'> 
          <'  their  100644 ba629238ca89489f2b350e196ca445e09d8bb834 initial-file\n'> <'@@ -1 +1,5 @@\n'> <'+<<<<<<< .our\n'> <' AAA\n'> <'+=======\n'> <'+BBB\n'> <'+>>>>>>> .their\n'> 
          <'EXPECTED\n'> <'\n'> <'\tgit reset --hard initial &&\n'> 
          <'\ttest_commit "change-a-b-diff-A" "initial-file" "AAA" &&\n'> <'\tgit reset --hard initial &&\n'> <'\ttest_commit "change-a-b-diff-B" "initial-file" "BBB" &&\n'> 
          <'\tgit merge-tree initial change-a-b-diff-A change-a-b-diff-B >actual &&\n'> <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'file change A, B (mixed)'>)} 
      {
        (SQ <'\n'> <'\tcat >expected <<\\EXPECTED &&\n'> <'changed in both\n'> 
          <'  base   100644 f4f1f998c7776568c4ff38f516d77fef9399b5a7 ONE\n'> <'  our    100644 af14c2c3475337c73759d561ef70b59e5c731176 ONE\n'> 
          <'  their  100644 372d761493f524d44d59bd24700c3bdf914c973c ONE\n'> <'@@ -7,7 +7,11 @@\n'> <' AAA\n'> <' AAA\n'> <' AAA\n'> <'+<<<<<<< .our\n'> <' BBB\n'> <'+=======\n'> 
          <'+CCC\n'> <'+>>>>>>> .their\n'> <' AAA\n'> <' AAA\n'> <' AAA\n'> <'EXPECTED\n'> <'\n'> 
          <'\tgit reset --hard initial &&\n'> <'\ttest_commit "change-a-b-mix-base" "ONE" "\n'> <'AAA\n'> <'AAA\n'> <'AAA\n'> <'AAA\n'> <'AAA\n'> 
          <'AAA\n'> <'AAA\n'> <'AAA\n'> <'AAA\n'> <'AAA\n'> <'AAA\n'> <'AAA\n'> <'AAA\n'> <'AAA\n'> <'AAA" &&\n'> 
          <'\ttest_commit "change-a-b-mix-A" "ONE" \\\n'> <'\t\t"$(sed -e "1{s/AAA/BBB/;}" -e "10{s/AAA/BBB/;}" <ONE)" &&\n'> 
          <'\tgit reset --hard change-a-b-mix-base &&\n'> <'\ttest_commit "change-a-b-mix-B" "ONE" \\\n'> 
          <'\t\t"$(sed -e "1{s/AAA/BBB/;}" -e "10{s/AAA/CCC/;}" <ONE)" &&\n'> <'\tgit merge-tree change-a-b-mix-base change-a-b-mix-A change-a-b-mix-B \\\n'> <'\t\t>actual &&\n'> 
          <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'file remove A, !B'>)} 
      {
        (SQ <'\n'> <'\tcat >expected <<\\EXPECTED &&\n'> <'EXPECTED\n'> <'\n'> 
          <'\tgit reset --hard initial &&\n'> <'\ttest_commit "rm-a-not-b-base" "ONE" "AAA" &&\n'> <'\tgit rm ONE &&\n'> 
          <'\tgit commit -m "rm-a-not-b" &&\n'> <'\tgit tag "rm-a-not-b" &&\n'> 
          <'\tgit merge-tree rm-a-not-b-base rm-a-not-b rm-a-not-b-base >actual &&\n'> <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'file remove !A, B'>)} 
      {
        (SQ <'\n'> <'\tcat >expected <<\\EXPECTED &&\n'> <'removed in remote\n'> 
          <'  base   100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE\n'> <'  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE\n'> <'@@ -1 +0,0 @@\n'> <'-AAA\n'> 
          <'EXPECTED\n'> <'\n'> <'\tgit reset --hard initial &&\n'> <'\ttest_commit "rm-not-a-b-base" "ONE" "AAA" &&\n'> 
          <'\tgit rm ONE &&\n'> <'\tgit commit -m "rm-not-a-b" &&\n'> <'\tgit tag "rm-not-a-b" &&\n'> 
          <'\tgit merge-tree rm-a-not-b-base rm-a-not-b-base rm-a-not-b >actual &&\n'> <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'file remove A, B (same)'>)} 
      {
        (SQ <'\n'> <'\tcat >expected <<\\EXPECTED &&\n'> <'EXPECTED\n'> <'\n'> 
          <'\tgit reset --hard initial &&\n'> <'\ttest_commit "rm-a-b-base" "ONE" "AAA" &&\n'> <'\tgit rm ONE &&\n'> 
          <'\tgit commit -m "rm-a-b" &&\n'> <'\tgit tag "rm-a-b" &&\n'> <'\tgit merge-tree rm-a-b-base rm-a-b rm-a-b >actual &&\n'> 
          <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'file change A, remove B'>)} 
      {
        (SQ <'\n'> <'\tcat >expected <<\\EXPECTED &&\n'> <'removed in remote\n'> 
          <'  base   100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE\n'> <'  our    100644 ba629238ca89489f2b350e196ca445e09d8bb834 ONE\n'> <'@@ -1 +0,0 @@\n'> <'-BBB\n'> 
          <'EXPECTED\n'> <'\n'> <'\tgit reset --hard initial &&\n'> <'\ttest_commit "change-a-rm-b-base" "ONE" "AAA" &&\n'> 
          <'\ttest_commit "change-a-rm-b-A" "ONE" "BBB" &&\n'> <'\tgit reset --hard change-a-rm-b-base &&\n'> <'\tgit rm ONE &&\n'> 
          <'\tgit commit -m "change-a-rm-b-B" &&\n'> <'\tgit tag "change-a-rm-b-B" &&\n'> 
          <'\tgit merge-tree change-a-rm-b-base change-a-rm-b-A change-a-rm-b-B \\\n'> <'\t\t>actual &&\n'> <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'file remove A, change B'>)} 
      {
        (SQ <'\n'> <'\tcat >expected <<\\EXPECTED &&\n'> <'removed in local\n'> 
          <'  base   100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE\n'> <'  their  100644 ba629238ca89489f2b350e196ca445e09d8bb834 ONE\n'> <'EXPECTED\n'> <'\n'> 
          <'\tgit reset --hard initial &&\n'> <'\ttest_commit "rm-a-change-b-base" "ONE" "AAA" &&\n'> <'\n'> <'\tgit rm ONE &&\n'> 
          <'\tgit commit -m "rm-a-change-b-A" &&\n'> <'\tgit tag "rm-a-change-b-A" &&\n'> <'\tgit reset --hard rm-a-change-b-base &&\n'> 
          <'\ttest_commit "rm-a-change-b-B" "ONE" "BBB" &&\n'> <'\tgit merge-tree rm-a-change-b-base rm-a-change-b-A rm-a-change-b-B \\\n'> <'\t\t>actual &&\n'> 
          <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'tree add A, B (same)'>)} 
      {
        (SQ <'\n'> <'\tcat >expect <<-\\EOF &&\n'> <'\tEOF\n'> <'\tgit reset --hard initial &&\n'> 
          <'\tmkdir sub &&\n'> <'\ttest_commit "add sub/file" "sub/file" "file" add-tree-A &&\n'> 
          <'\tgit merge-tree initial add-tree-A add-tree-A >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'tree add A, B (different)'>)} 
      {
        (SQ <'\n'> <'\tcat >expect <<-\\EOF &&\n'> <'\tadded in both\n'> 
          <'\t  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d sub/file\n'> <'\t  their  100644 ba629238ca89489f2b350e196ca445e09d8bb834 sub/file\n'> <'\t@@ -1 +1,5 @@\n'> 
          <'\t+<<<<<<< .our\n'> <'\t AAA\n'> <'\t+=======\n'> <'\t+BBB\n'> <'\t+>>>>>>> .their\n'> <'\tEOF\n'> 
          <'\tgit reset --hard initial &&\n'> <'\tmkdir sub &&\n'> <'\ttest_commit "add sub/file" "sub/file" "AAA" add-tree-a-b-A &&\n'> 
          <'\tgit reset --hard initial &&\n'> <'\tmkdir sub &&\n'> <'\ttest_commit "add sub/file" "sub/file" "BBB" add-tree-a-b-B &&\n'> 
          <'\tgit merge-tree initial add-tree-a-b-A add-tree-a-b-B >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'tree unchanged A, removed B'>)} 
      {
        (SQ <'\n'> <'\tcat >expect <<-\\EOF &&\n'> <'\tremoved in remote\n'> 
          <'\t  base   100644 43d5a8ed6ef6c00ff775008633f95787d088285d sub/file\n'> <'\t  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d sub/file\n'> <'\t@@ -1 +0,0 @@\n'> 
          <'\t-AAA\n'> <'\tEOF\n'> <'\tgit reset --hard initial &&\n'> <'\tmkdir sub &&\n'> 
          <'\ttest_commit "add sub/file" "sub/file" "AAA" tree-remove-b-initial &&\n'> <'\tgit rm sub/file &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m "remove sub/file" &&\n'> 
          <'\tgit tag tree-remove-b-B &&\n'> <'\tgit merge-tree tree-remove-b-initial tree-remove-b-initial tree-remove-b-B >actual &&\n'> 
          <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'turn file to tree'>)} 
      {
        (SQ <'\n'> <'\tgit reset --hard initial &&\n'> <'\trm initial-file &&\n'> 
          <'\tmkdir initial-file &&\n'> <'\ttest_commit "turn-file-to-tree" "initial-file/ONE" "CCC" &&\n'> 
          <'\tgit merge-tree initial initial turn-file-to-tree >actual &&\n'> <'\tcat >expect <<-\\EOF &&\n'> <'\tadded in remote\n'> 
          <'\t  their  100644 43aa4fdec31eb92e1fdc2f0ce6ea9ddb7c32bcf7 initial-file/ONE\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+CCC\n'> <'\tremoved in remote\n'> 
          <'\t  base   100644 e79c5e8f964493290a409888d5413a737e8e5dd5 initial-file\n'> <'\t  our    100644 e79c5e8f964493290a409888d5413a737e8e5dd5 initial-file\n'> <'\t@@ -1 +0,0 @@\n'> 
          <'\t-initial\n'> <'\tEOF\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'turn tree to file'>)} 
      {
        (SQ <'\n'> <'\tgit reset --hard initial &&\n'> <'\tmkdir dir &&\n'> 
          <'\ttest_commit "add-tree" "dir/path" "AAA" &&\n'> <'\ttest_commit "add-another-tree" "dir/another" "BBB" &&\n'> <'\trm -fr dir &&\n'> 
          <'\ttest_commit "make-file" "dir" "CCC" &&\n'> <'\tgit merge-tree add-tree add-another-tree make-file >actual &&\n'> <'\tcat >expect <<-\\EOF &&\n'> 
          <'\tremoved in remote\n'> <'\t  base   100644 43d5a8ed6ef6c00ff775008633f95787d088285d dir/path\n'> 
          <'\t  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d dir/path\n'> <'\t@@ -1 +0,0 @@\n'> <'\t-AAA\n'> <'\tadded in remote\n'> 
          <'\t  their  100644 43aa4fdec31eb92e1fdc2f0ce6ea9ddb7c32bcf7 dir\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+CCC\n'> <'\tEOF\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {<test_done>})
  ]
)