(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'more git add -u'>)}
          spids: [4]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (C {<test_expect_success>} {<setup>} 
      {
        (SQ <'\n'> <'\t>xyzzy &&\n'> <'\t_empty=$(git hash-object --stdin <xyzzy) &&\n'> 
          <'\t>yomin &&\n'> <'\t>caskly &&\n'> <'\tif test_have_prereq SYMLINKS; then\n'> <'\t\tln -s frotz nitfol &&\n'> 
          <'\t\tT_letter=T\n'> <'\telse\n'> <'\t\tprintf %s frotz > nitfol &&\n'> <'\t\tT_letter=M\n'> <'\tfi &&\n'> 
          <'\tmkdir rezrov &&\n'> <'\t>rezrov/bozbar &&\n'> <'\tgit add caskly xyzzy yomin nitfol rezrov/bozbar &&\n'> <'\n'> 
          <'\ttest_tick &&\n'> <'\tgit commit -m initial\n'> <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {<modify>} 
      {
        (SQ <'\n'> <'\trm -f xyzzy yomin nitfol caskly &&\n'> 
          <'\t# caskly disappears (not a submodule)\n'> <'\tmkdir caskly &&\n'> <'\t# nitfol changes from symlink to regular\n'> <'\t>nitfol &&\n'> 
          <'\t# rezrov/bozbar disappears\n'> <'\trm -fr rezrov &&\n'> <'\tif test_have_prereq SYMLINKS; then\n'> <'\t\tln -s xyzzy rezrov\n'> 
          <'\telse\n'> <'\t\tprintf %s xyzzy > rezrov\n'> <'\tfi &&\n'> <'\t# xyzzy disappears (not a submodule)\n'> 
          <'\tmkdir xyzzy &&\n'> <'\techo gnusto >xyzzy/bozbar &&\n'> <'\t# yomin gets replaced with a submodule\n'> 
          <'\tmkdir yomin &&\n'> <'\t>yomin/yomin &&\n'> <'\t(\n'> <'\t\tcd yomin &&\n'> <'\t\tgit init &&\n'> <'\t\tgit add yomin &&\n'> 
          <'\t\tgit commit -m "sub initial"\n'> <'\t) &&\n'> <'\tyomin=$(GIT_DIR=yomin/.git git rev-parse HEAD) &&\n'> 
          <'\t# yonk is added and then turned into a submodule\n'> <'\t# this should appear as T in diff-files and as A in diff-index\n'> <'\t>yonk &&\n'> 
          <'\tgit add yonk &&\n'> <'\trm -f yonk &&\n'> <'\tmkdir yonk &&\n'> <'\t>yonk/yonk &&\n'> <'\t(\n'> <'\t\tcd yonk &&\n'> 
          <'\t\tgit init &&\n'> <'\t\tgit add yonk &&\n'> <'\t\tgit commit -m "sub initial"\n'> <'\t) &&\n'> 
          <'\tyonk=$(GIT_DIR=yonk/.git git rev-parse HEAD) &&\n'> <'\t# zifmia is added and then removed\n'> 
          <'\t# this should appear in diff-files but not in diff-index.\n'> <'\t>zifmia &&\n'> <'\tgit add zifmia &&\n'> <'\trm -f zifmia &&\n'> <'\tmkdir zifmia &&\n'> <'\t{\n'> 
          <'\t\tgit ls-tree -r HEAD |\n'> <'\t\tsed -e "s/^/:/" -e "\n'> <'\t\t\t/\tcaskly/{\n'> <'\t\t\t\ts/\tcaskly/ $_z40 D&/\n'> 
          <'\t\t\t\ts/blob/000000/\n'> <'\t\t\t}\n'> <'\t\t\t/\tnitfol/{\n'> <'\t\t\t\ts/\tnitfol/ $_z40 $T_letter&/\n'> 
          <'\t\t\t\ts/blob/100644/\n'> <'\t\t\t}\n'> <'\t\t\t/\trezrov.bozbar/{\n'> <'\t\t\t\ts/\trezrov.bozbar/ $_z40 D&/\n'> 
          <'\t\t\t\ts/blob/000000/\n'> <'\t\t\t}\n'> <'\t\t\t/\txyzzy/{\n'> <'\t\t\t\ts/\txyzzy/ $_z40 D&/\n'> <'\t\t\t\ts/blob/000000/\n'> 
          <'\t\t\t}\n'> <'\t\t\t/\tyomin/{\n'> <'\t\t\t    s/\tyomin/ $_z40 T&/\n'> <'\t\t\t\ts/blob/160000/\n'> <'\t\t\t}\n'> 
          <'\t\t"\n'> <'\t} >expect &&\n'> <'\t{\n'> <'\t\tcat expect\n'> 
          <'\t\techo ":100644 160000 $_empty $_z40 T\tyonk"\n'> <'\t\techo ":100644 000000 $_empty $_z40 D\tzifmia"\n'> <'\t} >expect-files &&\n'> <'\t{\n'> 
          <'\t\tcat expect\n'> <'\t\techo ":000000 160000 $_z40 $_z40 A\tyonk"\n'> <'\t} >expect-index &&\n'> <'\t{\n'> 
          <'\t\techo "100644 $_empty 0\tnitfol"\n'> <'\t\techo "160000 $yomin 0\tyomin"\n'> <'\t\techo "160000 $yonk 0\tyonk"\n'> <'\t} >expect-final\n'>
        )
      }
    )
    (C {<test_expect_success>} {<diff-files>} 
      {(SQ <'\n'> <'\tgit diff-files --raw >actual &&\n'> <'\ttest_cmp expect-files actual\n'>)}
    )
    (C {<test_expect_success>} {<diff-index>} 
      {
        (SQ <'\n'> <'\tgit diff-index --raw HEAD -- >actual &&\n'> <'\ttest_cmp expect-index actual\n'>)
      }
    )
    (C {<test_expect_success>} {(SQ <'add -u'>)} 
      {
        (SQ <'\n'> <'\trm -f ".git/saved-index" &&\n'> <'\tcp -p ".git/index" ".git/saved-index" &&\n'> 
          <'\tgit add -u &&\n'> <'\tgit ls-files -s >actual &&\n'> <'\ttest_cmp expect-final actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'commit -a'>)} 
      {
        (SQ <'\n'> <'\tif test -f ".git/saved-index"\n'> <'\tthen\n'> <'\t\trm -f ".git/index" &&\n'> 
          <'\t\tmv ".git/saved-index" ".git/index"\n'> <'\tfi &&\n'> <'\tgit commit -m "second" -a &&\n'> <'\tgit ls-files -s >actual &&\n'> 
          <'\ttest_cmp expect-final actual &&\n'> <'\trm -f .git/index &&\n'> <'\tgit read-tree HEAD &&\n'> <'\tgit ls-files -s >actual &&\n'> 
          <'\ttest_cmp expect-final actual\n'>
        )
      }
    )
    (C {<test_done>})
  ]
)