(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'git apply trying to add an ending line.\n'> <'\n'>)}
        )
      ]
    )
    (C {(.)} {(./test-lib.sh)})
    (command.SimpleCommand
      words: [{(cat)}]
      redirects: [
        (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(test-patch)})
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)}
          here_end_span_id: 44
          stdin_parts: [
            ('diff --git a/file b/file\n')
            ('--- a/file\n')
            ('+++ b/file\n')
            ('@@ -1,2 +1,3 @@\n')
            (' a\n')
            (' b\n')
            ('+c\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [{(echo)} {(SQ <a>)}]
      redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(file)})]
    )
    (command.SimpleCommand
      words: [{(echo)} {(SQ <b>)}]
      redirects: [(redir.Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(file)})]
    )
    (command.SimpleCommand
      words: [{(echo)} {(SQ <c>)}]
      redirects: [(redir.Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(file)})]
    )
    (C {(test_expect_success)} {(setup)} {(SQ <'git update-index --add file'>)})
    (C {(test_expect_success)} {(SQ <'apply at the end'>)} 
      {(SQ <'test_must_fail git apply --index test-patch'>)}
    )
    (command.SimpleCommand
      words: [{(cat)}]
      redirects: [
        (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(test-patch)})
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)}
          here_end_span_id: 118
          stdin_parts: [
            ('diff a/file b/file\n')
            ('--- a/file\n')
            ('+++ b/file\n')
            ('@@ -1,2 +1,3 @@\n')
            ('+a\n')
            (' b\n')
            (' c\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [{(echo)} {(SQ <'a\n'> <'b\n'> <c>)}]
      redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(file)})]
    )
    (C {(git)} {(update-index)} {(file)})
    (C {(test_expect_success)} {(SQ <'apply at the beginning'>)} 
      {(SQ <'test_must_fail git apply --index test-patch'>)}
    )
    (C {(test_done)})
  ]
)