(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ (Token id:Id.Lit_Chars val:'git mv in subdirs' span_id:6))}
          spids: [4]
        )
      ]
    )
    (C {(.)} {(./test-lib.sh)})
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'prepare reference tree' span_id:19))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'mkdir path0 path1 &&\n' span_id:25) 
          (Token
            id: Id.Lit_Chars
            val: '     cp "$TEST_DIRECTORY"/../COPYING path0/COPYING &&\n'
            span_id: 26
          ) (Token id:Id.Lit_Chars val:'     git add path0/COPYING &&\n' span_id:27) 
          (Token id:Id.Lit_Chars val:'     git commit -m add -a' span_id:28)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'moving the file out of subdirectory' span_id:37))} {(SQ (Token id:Id.Lit_Chars val:'cd path0 && git mv COPYING ../path1/COPYING' span_id:43))}
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'commiting the change' span_id:55))} 
      {(SQ (Token id:Id.Lit_Chars val:'cd .. && git commit -m move-out -a' span_id:61))}
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'checking the commit' span_id:70))} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n'
            span_id: 76
          ) (Token id:Id.Lit_Chars val:'    grep "^R100..*path0/COPYING..*path1/COPYING"' span_id:77)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'moving the file back into subdirectory' span_id:86))} {(SQ (Token id:Id.Lit_Chars val:'cd path0 && git mv ../path1/COPYING COPYING' span_id:92))}
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'commiting the change' span_id:104))} 
      {(SQ (Token id:Id.Lit_Chars val:'cd .. && git commit -m move-in -a' span_id:110))}
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'checking the commit' span_id:119))} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n'
            span_id: 125
          ) (Token id:Id.Lit_Chars val:'    grep "^R100..*path1/COPYING..*path0/COPYING"' span_id:126)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'checking -k on non-existing file' span_id:135))} {(SQ (Token id:Id.Lit_Chars val:'git mv -k idontexist path0' span_id:141))}
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'checking -k on untracked file' span_id:150))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'touch untracked1 &&\n' span_id:156) 
          (Token id:Id.Lit_Chars val:'     git mv -k untracked1 path0 &&\n' span_id:157) (Token id:Id.Lit_Chars val:'     test -f untracked1 &&\n' span_id:158) 
          (Token id:Id.Lit_Chars val:'     test ! -f path0/untracked1' span_id:159)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'checking -k on multiple untracked files' span_id:168))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'touch untracked2 &&\n' span_id:174) 
          (Token
            id: Id.Lit_Chars
            val: '     git mv -k untracked1 untracked2 path0 &&\n'
            span_id: 175
          ) (Token id:Id.Lit_Chars val:'     test -f untracked1 &&\n' span_id:176) 
          (Token id:Id.Lit_Chars val:'     test -f untracked2 &&\n' span_id:177) (Token id:Id.Lit_Chars val:'     test ! -f path0/untracked1 &&\n' span_id:178) 
          (Token id:Id.Lit_Chars val:'     test ! -f path0/untracked2' span_id:179)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'checking -f on untracked file with existing target'
            span_id: 188
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'touch path0/untracked1 &&\n' span_id:194) 
          (Token
            id: Id.Lit_Chars
            val: '     test_must_fail git mv -f untracked1 path0 &&\n'
            span_id: 195
          ) (Token id:Id.Lit_Chars val:'     test ! -f .git/index.lock &&\n' span_id:196) 
          (Token id:Id.Lit_Chars val:'     test -f untracked1 &&\n' span_id:197) (Token id:Id.Lit_Chars val:'     test -f path0/untracked1' span_id:198)
        )
      }
    )
    (C {(rm)} {(-f)} {(idontexist)} {(untracked1)} {(untracked2)} {(path0/idontexist)} {(path0/untracked1)} 
      {(path0/untracked2)} {(.git/index.lock)}
    )
    (C {(rmdir)} {(path1)})
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'moving to absent target with trailing slash' span_id:237))} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'test_must_fail git mv path0/COPYING no-such-dir/ &&\n'
            span_id: 243
          ) (Token id:Id.Lit_Chars val:'     test_must_fail git mv path0/COPYING no-such-dir// &&\n' span_id:244) 
          (Token id:Id.Lit_Chars val:'     git mv path0/ no-such-dir/ &&\n' span_id:245) (Token id:Id.Lit_Chars val:'     test_path_is_dir no-such-dir' span_id:246)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'clean up' span_id:255))} 
      {(SQ (Token id:Id.Lit_Chars val:'git reset --hard' span_id:261))}
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'moving to existing untracked target with trailing slash'
            span_id: 270
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'mkdir path1 &&\n' span_id:276) 
          (Token id:Id.Lit_Chars val:'     git mv path0/ path1/ &&\n' span_id:277) (Token id:Id.Lit_Chars val:'     test_path_is_dir path1/path0/' span_id:278)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'moving to existing tracked target with trailing slash'
            span_id: 287
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'mkdir path2 &&\n' span_id:293) 
          (Token
            id: Id.Lit_Chars
            val: '     >path2/file && git add path2/file &&\n'
            span_id: 294
          ) (Token id:Id.Lit_Chars val:'     git mv path1/path0/ path2/ &&\n' span_id:295) 
          (Token id:Id.Lit_Chars val:'     test_path_is_dir path2/path0/' span_id:296)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'clean up' span_id:305))} 
      {(SQ (Token id:Id.Lit_Chars val:'git reset --hard' span_id:311))}
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'adding another file' span_id:320))} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'cp "$TEST_DIRECTORY"/../README.md path0/README &&\n'
            span_id: 326
          ) (Token id:Id.Lit_Chars val:'     git add path0/README &&\n' span_id:327) 
          (Token id:Id.Lit_Chars val:'     git commit -m add2 -a' span_id:328)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'moving whole subdirectory' span_id:337))} {(SQ (Token id:Id.Lit_Chars val:'git mv path0 path2' span_id:343))}
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'commiting the change' span_id:352))} 
      {(SQ (Token id:Id.Lit_Chars val:'git commit -m dir-move -a' span_id:358))}
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'checking the commit' span_id:367))} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n'
            span_id: 373
          ) (Token id:Id.Lit_Chars val:'     grep "^R100..*path0/COPYING..*path2/COPYING" &&\n' span_id:374) 
          (Token
            id: Id.Lit_Chars
            val: '     git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n'
            span_id: 375
          ) (Token id:Id.Lit_Chars val:'     grep "^R100..*path0/README..*path2/README"' span_id:376)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'succeed when source is a prefix of destination' span_id:385))} {(SQ (Token id:Id.Lit_Chars val:'git mv path2/COPYING path2/COPYING-renamed' span_id:391))}
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'moving whole subdirectory into subdirectory' span_id:400))} {(SQ (Token id:Id.Lit_Chars val:'git mv path2 path1' span_id:406))}
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'commiting the change' span_id:415))} 
      {(SQ (Token id:Id.Lit_Chars val:'git commit -m dir-move -a' span_id:421))}
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'checking the commit' span_id:430))} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n'
            span_id: 436
          ) 
          (Token
            id: Id.Lit_Chars
            val: '     grep "^R100..*path2/COPYING..*path1/path2/COPYING" &&\n'
            span_id: 437
          ) (Token id:Id.Lit_Chars val:'     git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n' span_id:438) 
          (Token
            id: Id.Lit_Chars
            val: '     grep "^R100..*path2/README..*path1/path2/README"'
            span_id: 439
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'do not move directory over existing directory' span_id:448))} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0'
            span_id: 454
          )
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'move into "."' span_id:463))} 
      {(SQ (Token id:Id.Lit_Chars val:'git mv path1/path2/ .' span_id:469))}
    )
    (C {(test_expect_success)} {(DQ ("Michael Cassar's test case"))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:480) 
          (Token id:Id.Lit_Chars val:'\trm -fr .git papers partA &&\n' span_id:481) (Token id:Id.Lit_Chars val:'\tgit init &&\n' span_id:482) 
          (Token
            id: Id.Lit_Chars
            val: '\tmkdir -p papers/unsorted papers/all-papers partA &&\n'
            span_id: 483
          ) (Token id:Id.Lit_Chars val:'\techo a > papers/unsorted/Thesis.pdf &&\n' span_id:484) 
          (Token id:Id.Lit_Chars val:'\techo b > partA/outline.txt &&\n' span_id:485) (Token id:Id.Lit_Chars val:'\techo c > papers/unsorted/_another &&\n' span_id:486) 
          (Token id:Id.Lit_Chars val:'\tgit add papers partA &&\n' span_id:487) (Token id:Id.Lit_Chars val:'\tT1=$(git write-tree) &&\n' span_id:488) 
          (Token id:Id.Lit_Chars val:'\n' span_id:489) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit mv papers/unsorted/Thesis.pdf papers/all-papers/moo-blah.pdf &&\n'
            span_id: 490
          ) (Token id:Id.Lit_Chars val:'\n' span_id:491) 
          (Token id:Id.Lit_Chars val:'\tT=$(git write-tree) &&\n' span_id:492) (Token id:Id.Lit_Chars val:'\tgit ls-tree -r $T | verbose grep partA/outline.txt\n' span_id:493)
        )
      }
    )
    (C {(rm)} {(-fr)} {(papers)} {(partA)} {(path) (Id.Lit_QMark '?')})
    (C {(test_expect_success)} {(DQ ("Sergey Vlasov's test case"))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:516) 
          (Token id:Id.Lit_Chars val:'\trm -fr .git &&\n' span_id:517) (Token id:Id.Lit_Chars val:'\tgit init &&\n' span_id:518) 
          (Token id:Id.Lit_Chars val:'\tmkdir ab &&\n' span_id:519) (Token id:Id.Lit_Chars val:'\tdate >ab.c &&\n' span_id:520) 
          (Token id:Id.Lit_Chars val:'\tdate >ab/d &&\n' span_id:521) (Token id:Id.Lit_Chars val:'\tgit add ab.c ab &&\n' span_id:522) 
          (Token id:Id.Lit_Chars val:'\tgit commit -m ' span_id:523)
        ) (initial) 
        (SQ (Token id:Id.Lit_Chars val:' &&\n' span_id:527) 
          (Token id:Id.Lit_Chars val:'\tgit mv ab a\n' span_id:528)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'absolute pathname' span_id:535))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'(\n' span_id:539) (Token id:Id.Lit_Chars val:'\n' span_id:540) 
          (Token id:Id.Lit_Chars val:'\trm -fr mine &&\n' span_id:541) (Token id:Id.Lit_Chars val:'\tmkdir mine &&\n' span_id:542) 
          (Token id:Id.Lit_Chars val:'\tcd mine &&\n' span_id:543) (Token id:Id.Lit_Chars val:'\ttest_create_repo one &&\n' span_id:544) 
          (Token id:Id.Lit_Chars val:'\tcd one &&\n' span_id:545) (Token id:Id.Lit_Chars val:'\tmkdir sub &&\n' span_id:546) 
          (Token id:Id.Lit_Chars val:'\t>sub/file &&\n' span_id:547) (Token id:Id.Lit_Chars val:'\tgit add sub/file &&\n' span_id:548) 
          (Token id:Id.Lit_Chars val:'\n' span_id:549) (Token id:Id.Lit_Chars val:'\tgit mv sub "$(pwd)/in" &&\n' span_id:550) 
          (Token id:Id.Lit_Chars val:'\t! test -d sub &&\n' span_id:551) (Token id:Id.Lit_Chars val:'\ttest -d in &&\n' span_id:552) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit ls-files --error-unmatch in/file\n'
            span_id: 553
          ) (Token id:Id.Lit_Chars val:'\n' span_id:554) (Token id:Id.Lit_Chars val:'\n' span_id:555) 
          (Token id:Id.Lit_Chars val:')' span_id:556)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'absolute pathname outside should fail' span_id:563))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'(\n' span_id:567) (Token id:Id.Lit_Chars val:'\n' span_id:568) 
          (Token id:Id.Lit_Chars val:'\trm -fr mine &&\n' span_id:569) (Token id:Id.Lit_Chars val:'\tmkdir mine &&\n' span_id:570) 
          (Token id:Id.Lit_Chars val:'\tcd mine &&\n' span_id:571) (Token id:Id.Lit_Chars val:'\tout=$(pwd) &&\n' span_id:572) 
          (Token id:Id.Lit_Chars val:'\ttest_create_repo one &&\n' span_id:573) (Token id:Id.Lit_Chars val:'\tcd one &&\n' span_id:574) 
          (Token id:Id.Lit_Chars val:'\tmkdir sub &&\n' span_id:575) (Token id:Id.Lit_Chars val:'\t>sub/file &&\n' span_id:576) 
          (Token id:Id.Lit_Chars val:'\tgit add sub/file &&\n' span_id:577) (Token id:Id.Lit_Chars val:'\n' span_id:578) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git mv sub "$out/out" &&\n'
            span_id: 579
          ) (Token id:Id.Lit_Chars val:'\ttest -d sub &&\n' span_id:580) 
          (Token id:Id.Lit_Chars val:'\t! test -d ../in &&\n' span_id:581) (Token id:Id.Lit_Chars val:'\tgit ls-files --error-unmatch sub/file\n' span_id:582) 
          (Token id:Id.Lit_Chars val:'\n' span_id:583) (Token id:Id.Lit_Chars val:')' span_id:584)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'git mv to move multiple sources into a directory'
            span_id: 591
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:595) 
          (Token id:Id.Lit_Chars val:'\trm -fr .git && git init &&\n' span_id:596) (Token id:Id.Lit_Chars val:'\tmkdir dir other &&\n' span_id:597) 
          (Token id:Id.Lit_Chars val:'\t>dir/a.txt &&\n' span_id:598) (Token id:Id.Lit_Chars val:'\t>dir/b.txt &&\n' span_id:599) 
          (Token id:Id.Lit_Chars val:'\tgit add dir/?.txt &&\n' span_id:600) (Token id:Id.Lit_Chars val:'\tgit mv dir/a.txt dir/b.txt other &&\n' span_id:601) 
          (Token id:Id.Lit_Chars val:'\tgit ls-files >actual &&\n' span_id:602) (Token id:Id.Lit_Chars val:'\t{ echo other/a.txt; echo other/b.txt; } >expect &&\n' span_id:603) 
          (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:604)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'git mv should not change sha1 of moved cache entry'
            span_id: 611
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:615) (Token id:Id.Lit_Chars val:'\n' span_id:616) 
          (Token id:Id.Lit_Chars val:'\trm -fr .git &&\n' span_id:617) (Token id:Id.Lit_Chars val:'\tgit init &&\n' span_id:618) 
          (Token id:Id.Lit_Chars val:'\techo 1 >dirty &&\n' span_id:619) (Token id:Id.Lit_Chars val:'\tgit add dirty &&\n' span_id:620) 
          (Token
            id: Id.Lit_Chars
            val: '\tentry="$(git ls-files --stage dirty | cut -f 1)" &&\n'
            span_id: 621
          ) (Token id:Id.Lit_Chars val:'\tgit mv dirty dirty2 &&\n' span_id:622) 
          (Token
            id: Id.Lit_Chars
            val: '\t[ "$entry" = "$(git ls-files --stage dirty2 | cut -f 1)" ] &&\n'
            span_id: 623
          ) (Token id:Id.Lit_Chars val:'\techo 2 >dirty2 &&\n' span_id:624) 
          (Token id:Id.Lit_Chars val:'\tgit mv dirty2 dirty &&\n' span_id:625) 
          (Token
            id: Id.Lit_Chars
            val: '\t[ "$entry" = "$(git ls-files --stage dirty | cut -f 1)" ]\n'
            span_id: 626
          ) (Token id:Id.Lit_Chars val:'\n' span_id:627)
        )
      }
    )
    (C {(rm)} {(-f)} {(dirty)} {(dirty2)})
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'git mv should overwrite symlink to a file' span_id:643))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:647) (Token id:Id.Lit_Chars val:'\n' span_id:648) 
          (Token id:Id.Lit_Chars val:'\trm -fr .git &&\n' span_id:649) (Token id:Id.Lit_Chars val:'\tgit init &&\n' span_id:650) 
          (Token id:Id.Lit_Chars val:'\techo 1 >moved &&\n' span_id:651) (Token id:Id.Lit_Chars val:'\ttest_ln_s_add moved symlink &&\n' span_id:652) 
          (Token id:Id.Lit_Chars val:'\tgit add moved &&\n' span_id:653) (Token id:Id.Lit_Chars val:'\ttest_must_fail git mv moved symlink &&\n' span_id:654) 
          (Token id:Id.Lit_Chars val:'\tgit mv -f moved symlink &&\n' span_id:655) (Token id:Id.Lit_Chars val:'\t! test -e moved &&\n' span_id:656) 
          (Token id:Id.Lit_Chars val:'\ttest -f symlink &&\n' span_id:657) (Token id:Id.Lit_Chars val:'\ttest "$(cat symlink)" = 1 &&\n' span_id:658) 
          (Token id:Id.Lit_Chars val:'\tgit update-index --refresh &&\n' span_id:659) (Token id:Id.Lit_Chars val:'\tgit diff-files --quiet\n' span_id:660) 
          (Token id:Id.Lit_Chars val:'\n' span_id:661)
        )
      }
    )
    (C {(rm)} {(-f)} {(moved)} {(symlink)})
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'git mv should overwrite file with a symlink' span_id:677))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:681) (Token id:Id.Lit_Chars val:'\n' span_id:682) 
          (Token id:Id.Lit_Chars val:'\trm -fr .git &&\n' span_id:683) (Token id:Id.Lit_Chars val:'\tgit init &&\n' span_id:684) 
          (Token id:Id.Lit_Chars val:'\techo 1 >moved &&\n' span_id:685) (Token id:Id.Lit_Chars val:'\ttest_ln_s_add moved symlink &&\n' span_id:686) 
          (Token id:Id.Lit_Chars val:'\tgit add moved &&\n' span_id:687) (Token id:Id.Lit_Chars val:'\ttest_must_fail git mv symlink moved &&\n' span_id:688) 
          (Token id:Id.Lit_Chars val:'\tgit mv -f symlink moved &&\n' span_id:689) (Token id:Id.Lit_Chars val:'\t! test -e symlink &&\n' span_id:690) 
          (Token id:Id.Lit_Chars val:'\tgit update-index --refresh &&\n' span_id:691) (Token id:Id.Lit_Chars val:'\tgit diff-files --quiet\n' span_id:692) 
          (Token id:Id.Lit_Chars val:'\n' span_id:693)
        )
      }
    )
    (C {(test_expect_success)} {(SYMLINKS)} 
      {(SQ (Token id:Id.Lit_Chars val:'check moved symlink' span_id:702))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:706) (Token id:Id.Lit_Chars val:'\n' span_id:707) 
          (Token id:Id.Lit_Chars val:'\ttest -h moved\n' span_id:708)
        )
      }
    )
    (C {(rm)} {(-f)} {(moved)} {(symlink)})
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'setup submodule' span_id:724))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:728) 
          (Token id:Id.Lit_Chars val:'\tgit commit -m initial &&\n' span_id:729) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:730) 
          (Token id:Id.Lit_Chars val:'\tgit submodule add ./. sub &&\n' span_id:731) (Token id:Id.Lit_Chars val:'\techo content >file &&\n' span_id:732) 
          (Token id:Id.Lit_Chars val:'\tgit add file &&\n' span_id:733) (Token id:Id.Lit_Chars val:'\tgit commit -m "added sub and file" &&\n' span_id:734) 
          (Token
            id: Id.Lit_Chars
            val: '\tmkdir -p deep/directory/hierarchy &&\n'
            span_id: 735
          ) (Token id:Id.Lit_Chars val:'\tgit submodule add ./. deep/directory/hierarchy/sub &&\n' span_id:736) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit commit -m "added another submodule" &&\n'
            span_id: 737
          ) (Token id:Id.Lit_Chars val:'\tgit branch submodule\n' span_id:738)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'git mv cannot move a submodule in a file' span_id:745))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:749) 
          (Token id:Id.Lit_Chars val:'\ttest_must_fail git mv sub file\n' span_id:750)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'git mv moves a submodule with a .git directory and no .gitmodules'
            span_id: 757
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:761) 
          (Token
            id: Id.Lit_Chars
            val: '\tentry="$(git ls-files --stage sub | cut -f 1)" &&\n'
            span_id: 762
          ) (Token id:Id.Lit_Chars val:'\tgit rm .gitmodules &&\n' span_id:763) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:764) (Token id:Id.Lit_Chars val:'\t\tcd sub &&\n' span_id:765) 
          (Token id:Id.Lit_Chars val:'\t\trm -f .git &&\n' span_id:766) (Token id:Id.Lit_Chars val:'\t\tcp -R -P -p ../.git/modules/sub .git &&\n' span_id:767) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tGIT_WORK_TREE=. git config --unset core.worktree\n'
            span_id: 768
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:769) 
          (Token id:Id.Lit_Chars val:'\tmkdir mod &&\n' span_id:770) (Token id:Id.Lit_Chars val:'\tgit mv sub mod/sub &&\n' span_id:771) 
          (Token id:Id.Lit_Chars val:'\t! test -e sub &&\n' span_id:772) 
          (Token
            id: Id.Lit_Chars
            val: '\t[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&\n'
            span_id: 773
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:774) 
          (Token id:Id.Lit_Chars val:'\t\tcd mod/sub &&\n' span_id:775) (Token id:Id.Lit_Chars val:'\t\tgit status\n' span_id:776) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:777) (Token id:Id.Lit_Chars val:'\tgit update-index --refresh &&\n' span_id:778) 
          (Token id:Id.Lit_Chars val:'\tgit diff-files --quiet\n' span_id:779)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'git mv moves a submodule with a .git directory and .gitmodules'
            span_id: 786
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:790) 
          (Token id:Id.Lit_Chars val:'\trm -rf mod &&\n' span_id:791) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:792) 
          (Token id:Id.Lit_Chars val:'\tgit submodule update &&\n' span_id:793) (Token id:Id.Lit_Chars val:'\tentry="$(git ls-files --stage sub | cut -f 1)" &&\n' span_id:794) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:795) (Token id:Id.Lit_Chars val:'\t\tcd sub &&\n' span_id:796) 
          (Token id:Id.Lit_Chars val:'\t\trm -f .git &&\n' span_id:797) (Token id:Id.Lit_Chars val:'\t\tcp -R -P -p ../.git/modules/sub .git &&\n' span_id:798) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tGIT_WORK_TREE=. git config --unset core.worktree\n'
            span_id: 799
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:800) 
          (Token id:Id.Lit_Chars val:'\tmkdir mod &&\n' span_id:801) (Token id:Id.Lit_Chars val:'\tgit mv sub mod/sub &&\n' span_id:802) 
          (Token id:Id.Lit_Chars val:'\t! test -e sub &&\n' span_id:803) 
          (Token
            id: Id.Lit_Chars
            val: '\t[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&\n'
            span_id: 804
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:805) 
          (Token id:Id.Lit_Chars val:'\t\tcd mod/sub &&\n' span_id:806) (Token id:Id.Lit_Chars val:'\t\tgit status\n' span_id:807) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:808) (Token id:Id.Lit_Chars val:'\techo mod/sub >expected &&\n' span_id:809) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit config -f .gitmodules submodule.sub.path >actual &&\n'
            span_id: 810
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual &&\n' span_id:811) 
          (Token id:Id.Lit_Chars val:'\tgit update-index --refresh &&\n' span_id:812) (Token id:Id.Lit_Chars val:'\tgit diff-files --quiet\n' span_id:813)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'git mv moves a submodule with gitfile' span_id:820))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:824) 
          (Token id:Id.Lit_Chars val:'\trm -rf mod &&\n' span_id:825) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:826) 
          (Token id:Id.Lit_Chars val:'\tgit submodule update &&\n' span_id:827) (Token id:Id.Lit_Chars val:'\tentry="$(git ls-files --stage sub | cut -f 1)" &&\n' span_id:828) 
          (Token id:Id.Lit_Chars val:'\tmkdir mod &&\n' span_id:829) (Token id:Id.Lit_Chars val:'\t(\n' span_id:830) 
          (Token id:Id.Lit_Chars val:'\t\tcd mod &&\n' span_id:831) (Token id:Id.Lit_Chars val:'\t\tgit mv ../sub/ .\n' span_id:832) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:833) (Token id:Id.Lit_Chars val:'\t! test -e sub &&\n' span_id:834) 
          (Token
            id: Id.Lit_Chars
            val: '\t[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&\n'
            span_id: 835
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:836) 
          (Token id:Id.Lit_Chars val:'\t\tcd mod/sub &&\n' span_id:837) (Token id:Id.Lit_Chars val:'\t\tgit status\n' span_id:838) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:839) (Token id:Id.Lit_Chars val:'\techo mod/sub >expected &&\n' span_id:840) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit config -f .gitmodules submodule.sub.path >actual &&\n'
            span_id: 841
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual &&\n' span_id:842) 
          (Token id:Id.Lit_Chars val:'\tgit update-index --refresh &&\n' span_id:843) (Token id:Id.Lit_Chars val:'\tgit diff-files --quiet\n' span_id:844)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'mv does not complain when no .gitmodules file is found'
            span_id: 851
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:855) 
          (Token id:Id.Lit_Chars val:'\trm -rf mod &&\n' span_id:856) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:857) 
          (Token id:Id.Lit_Chars val:'\tgit submodule update &&\n' span_id:858) (Token id:Id.Lit_Chars val:'\tgit rm .gitmodules &&\n' span_id:859) 
          (Token
            id: Id.Lit_Chars
            val: '\tentry="$(git ls-files --stage sub | cut -f 1)" &&\n'
            span_id: 860
          ) (Token id:Id.Lit_Chars val:'\tmkdir mod &&\n' span_id:861) 
          (Token id:Id.Lit_Chars val:'\tgit mv sub mod/sub 2>actual.err &&\n' span_id:862) (Token id:Id.Lit_Chars val:'\t! test -s actual.err &&\n' span_id:863) 
          (Token id:Id.Lit_Chars val:'\t! test -e sub &&\n' span_id:864) 
          (Token
            id: Id.Lit_Chars
            val: '\t[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&\n'
            span_id: 865
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:866) 
          (Token id:Id.Lit_Chars val:'\t\tcd mod/sub &&\n' span_id:867) (Token id:Id.Lit_Chars val:'\t\tgit status\n' span_id:868) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:869) (Token id:Id.Lit_Chars val:'\tgit update-index --refresh &&\n' span_id:870) 
          (Token id:Id.Lit_Chars val:'\tgit diff-files --quiet\n' span_id:871)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'mv will error out on a modified .gitmodules file unless staged'
            span_id: 878
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:882) 
          (Token id:Id.Lit_Chars val:'\trm -rf mod &&\n' span_id:883) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:884) 
          (Token id:Id.Lit_Chars val:'\tgit submodule update &&\n' span_id:885) (Token id:Id.Lit_Chars val:'\tgit config -f .gitmodules foo.bar true &&\n' span_id:886) 
          (Token
            id: Id.Lit_Chars
            val: '\tentry="$(git ls-files --stage sub | cut -f 1)" &&\n'
            span_id: 887
          ) (Token id:Id.Lit_Chars val:'\tmkdir mod &&\n' span_id:888) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git mv sub mod/sub 2>actual.err &&\n'
            span_id: 889
          ) (Token id:Id.Lit_Chars val:'\ttest -s actual.err &&\n' span_id:890) 
          (Token id:Id.Lit_Chars val:'\ttest -e sub &&\n' span_id:891) (Token id:Id.Lit_Chars val:'\tgit diff-files --quiet -- sub &&\n' span_id:892) 
          (Token id:Id.Lit_Chars val:'\tgit add .gitmodules &&\n' span_id:893) (Token id:Id.Lit_Chars val:'\tgit mv sub mod/sub 2>actual.err &&\n' span_id:894) 
          (Token id:Id.Lit_Chars val:'\t! test -s actual.err &&\n' span_id:895) (Token id:Id.Lit_Chars val:'\t! test -e sub &&\n' span_id:896) 
          (Token
            id: Id.Lit_Chars
            val: '\t[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&\n'
            span_id: 897
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:898) 
          (Token id:Id.Lit_Chars val:'\t\tcd mod/sub &&\n' span_id:899) (Token id:Id.Lit_Chars val:'\t\tgit status\n' span_id:900) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:901) (Token id:Id.Lit_Chars val:'\tgit update-index --refresh &&\n' span_id:902) 
          (Token id:Id.Lit_Chars val:'\tgit diff-files --quiet\n' span_id:903)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'mv issues a warning when section is not found in .gitmodules'
            span_id: 910
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:914) 
          (Token id:Id.Lit_Chars val:'\trm -rf mod &&\n' span_id:915) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:916) 
          (Token id:Id.Lit_Chars val:'\tgit submodule update &&\n' span_id:917) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit config -f .gitmodules --remove-section submodule.sub &&\n'
            span_id: 918
          ) (Token id:Id.Lit_Chars val:'\tgit add .gitmodules &&\n' span_id:919) 
          (Token
            id: Id.Lit_Chars
            val: '\tentry="$(git ls-files --stage sub | cut -f 1)" &&\n'
            span_id: 920
          ) 
          (Token
            id: Id.Lit_Chars
            val: 
'\techo "warning: Could not find section in .gitmodules where path=sub" >expect.err &&\n'
            span_id: 921
          ) (Token id:Id.Lit_Chars val:'\tmkdir mod &&\n' span_id:922) 
          (Token id:Id.Lit_Chars val:'\tgit mv sub mod/sub 2>actual.err &&\n' span_id:923) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expect.err actual.err &&\n' span_id:924) 
          (Token id:Id.Lit_Chars val:'\t! test -e sub &&\n' span_id:925) 
          (Token
            id: Id.Lit_Chars
            val: '\t[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&\n'
            span_id: 926
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:927) 
          (Token id:Id.Lit_Chars val:'\t\tcd mod/sub &&\n' span_id:928) (Token id:Id.Lit_Chars val:'\t\tgit status\n' span_id:929) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:930) (Token id:Id.Lit_Chars val:'\tgit update-index --refresh &&\n' span_id:931) 
          (Token id:Id.Lit_Chars val:'\tgit diff-files --quiet\n' span_id:932)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'mv --dry-run does not touch the submodule or .gitmodules'
            span_id: 939
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:943) 
          (Token id:Id.Lit_Chars val:'\trm -rf mod &&\n' span_id:944) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:945) 
          (Token id:Id.Lit_Chars val:'\tgit submodule update &&\n' span_id:946) (Token id:Id.Lit_Chars val:'\tmkdir mod &&\n' span_id:947) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit mv -n sub mod/sub 2>actual.err &&\n'
            span_id: 948
          ) (Token id:Id.Lit_Chars val:'\ttest -f sub/.git &&\n' span_id:949) 
          (Token id:Id.Lit_Chars val:'\tgit diff-index --exit-code HEAD &&\n' span_id:950) (Token id:Id.Lit_Chars val:'\tgit update-index --refresh &&\n' span_id:951) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit diff-files --quiet -- sub .gitmodules\n'
            span_id: 952
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'checking out a commit before submodule moved needs manual updates'
            span_id: 959
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:963) 
          (Token id:Id.Lit_Chars val:'\tgit mv sub sub2 &&\n' span_id:964) (Token id:Id.Lit_Chars val:'\tgit commit -m "moved sub to sub2" &&\n' span_id:965) 
          (Token id:Id.Lit_Chars val:'\tgit checkout -q HEAD^ 2>actual &&\n' span_id:966) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_i18ngrep "^warning: unable to rmdir sub2:" actual &&\n'
            span_id: 967
          ) (Token id:Id.Lit_Chars val:'\tgit status -s sub2 >actual &&\n' span_id:968) 
          (Token id:Id.Lit_Chars val:'\techo "?? sub2/" >expected &&\n' span_id:969) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual &&\n' span_id:970) 
          (Token id:Id.Lit_Chars val:'\t! test -f sub/.git &&\n' span_id:971) (Token id:Id.Lit_Chars val:'\ttest -f sub2/.git &&\n' span_id:972) 
          (Token id:Id.Lit_Chars val:'\tgit submodule update &&\n' span_id:973) (Token id:Id.Lit_Chars val:'\ttest -f sub/.git &&\n' span_id:974) 
          (Token id:Id.Lit_Chars val:'\trm -rf sub2 &&\n' span_id:975) (Token id:Id.Lit_Chars val:'\tgit diff-index --exit-code HEAD &&\n' span_id:976) 
          (Token id:Id.Lit_Chars val:'\tgit update-index --refresh &&\n' span_id:977) (Token id:Id.Lit_Chars val:'\tgit diff-files --quiet -- sub .gitmodules &&\n' span_id:978) 
          (Token id:Id.Lit_Chars val:'\tgit status -s sub2 >actual &&\n' span_id:979) (Token id:Id.Lit_Chars val:'\t! test -s actual\n' span_id:980)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'mv -k does not accidentally destroy submodules' span_id:987))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:991) 
          (Token id:Id.Lit_Chars val:'\tgit checkout submodule &&\n' span_id:992) (Token id:Id.Lit_Chars val:'\tmkdir dummy dest &&\n' span_id:993) 
          (Token id:Id.Lit_Chars val:'\tgit mv -k dummy sub dest &&\n' span_id:994) (Token id:Id.Lit_Chars val:'\tgit status --porcelain >actual &&\n' span_id:995) 
          (Token
            id: Id.Lit_Chars
            val: '\tgrep "^R  sub -> dest/sub" actual &&\n'
            span_id: 996
          ) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:997) 
          (Token id:Id.Lit_Chars val:'\tgit checkout .\n' span_id:998)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'moving a submodule in nested directories' span_id:1005))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1009) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:1010) (Token id:Id.Lit_Chars val:'\t\tcd deep &&\n' span_id:1011) 
          (Token id:Id.Lit_Chars val:'\t\tgit mv directory ../ &&\n' span_id:1012) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t# git status would fail if the update of linking git dir to\n'
            span_id: 1013
          ) (Token id:Id.Lit_Chars val:'\t\t# work dir of the submodule failed.\n' span_id:1014) 
          (Token id:Id.Lit_Chars val:'\t\tgit status &&\n' span_id:1015) 
          (Token
            id: Id.Lit_Chars
            val: 
'\t\tgit config -f ../.gitmodules submodule.deep/directory/hierarchy/sub.path >../actual &&\n'
            span_id: 1016
          ) (Token id:Id.Lit_Chars val:'\t\techo "directory/hierarchy/sub" >../expect\n' span_id:1017) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1018) (Token id:Id.Lit_Chars val:'\ttest_cmp actual expect\n' span_id:1019)
        )
      }
    )
    (C {(test_done)})
  ]
)