(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'git apply submodule tests'>)}
          spids: [13]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (C {<test_expect_success>} {<setup>} 
      {
        (SQ <'\n'> <'\tcat > create-sm.patch <<EOF &&\n'> <'diff --git a/dir/sm b/dir/sm\n'> 
          <'new file mode 160000\n'> <'index 0000000..0123456\n'> <'--- /dev/null\n'> <'+++ b/dir/sm\n'> <'@@ -0,0 +1 @@\n'> 
          <'+Subproject commit 0123456789abcdef0123456789abcdef01234567\n'> <'EOF\n'> <'\tcat > remove-sm.patch <<EOF\n'> <'diff --git a/dir/sm b/dir/sm\n'> 
          <'deleted file mode 160000\n'> <'index 0123456..0000000\n'> <'--- a/dir/sm\n'> <'+++ /dev/null\n'> <'@@ -1 +0,0 @@\n'> 
          <'-Subproject commit 0123456789abcdef0123456789abcdef01234567\n'> <'EOF\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'removing a submodule also removes all leading subdirectories'>)} 
      {
        (SQ <'\n'> <'\tgit apply --index create-sm.patch &&\n'> <'\ttest -d dir/sm &&\n'> 
          <'\tgit apply --index remove-sm.patch &&\n'> <'\ttest \\! -d dir\n'>
        )
      }
    )
    (C {<test_done>})
  ]
)