(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'git status for submodule'>)}
          spids: [4]
        )
      ]
      spids: [4]
    )
    (C {(.)} {(./test-lib.sh)})
    (FuncDef
      name: test_create_repo_with_commit
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(test_create_repo)} {(DQ ($ VSub_Number '$1'))})
                (Subshell
                  child: 
                    (AndOr
                      children: [
                        (C {(cd)} {(DQ ($ VSub_Number '$1'))})
                        (AndOr
                          children: [
                            (SimpleCommand
                              words: [{(Lit_Other ':')}]
                              redirects: [
                                (Redir
                                  op_id: Redir_Great
                                  fd: 16777215
                                  arg_word: {(bar)}
                                  spids: [46]
                                )
                              ]
                            )
                            (AndOr
                              children: [
                                (C {(git)} {(add)} {(bar)})
                                (AndOr
                                  children: [
                                    (C {(git)} {(commit)} {(-m)} {(DQ (' Add bar'))})
                                    (AndOr
                                      children: [
                                        (SimpleCommand
                                          words: [{(Lit_Other ':')}]
                                          redirects: [
                                            (Redir
                                              op_id: Redir_Great
                                              fd: 16777215
                                              arg_word: {(foo)}
                                              spids: [76]
                                            )
                                          ]
                                        )
                                        (AndOr
                                          children: [
                                            (C {(git)} {(add)} {(foo)})
                                            (C {(git)} {(commit)} {(-m)} {(DQ (' Add foo'))})
                                          ]
                                          op_id: Op_DAmp
                                        )
                                      ]
                                      op_id: Op_DAmp
                                    )
                                  ]
                                  op_id: Op_DAmp
                                )
                              ]
                              op_id: Op_DAmp
                            )
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  spids: [32 102]
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [20]
        )
      spids: [15 19]
    )
    (C {(test_expect_success)} {(SQ <setup>)} 
      {
        (SQ <'\n'> <'\ttest_create_repo_with_commit sub &&\n'> <'\techo output > .gitignore &&\n'> 
          <'\tgit add sub .gitignore &&\n'> <'\tgit commit -m "Add submodule sub"\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status clean'>)} 
      {(SQ <'\n'> <'\tgit status >output &&\n'> <'\ttest_i18ngrep "nothing to commit" output\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'commit --dry-run -a clean'>)} 
      {
        (SQ <'\n'> <'\ttest_must_fail git commit --dry-run -a >output &&\n'> 
          <'\ttest_i18ngrep "nothing to commit" output\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status with modified file in submodule'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git reset --hard) &&\n'> <'\techo "changed" >sub/foo &&\n'> 
          <'\tgit status >output &&\n'> <'\ttest_i18ngrep "modified:   sub (modified content)" output\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status with modified file in submodule (porcelain)'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git reset --hard) &&\n'> <'\techo "changed" >sub/foo &&\n'> 
          <'\tgit status --porcelain >output &&\n'> <'\tdiff output - <<-\\EOF\n'> <'\t M sub\n'> <'\tEOF\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status with added file in submodule'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git reset --hard && echo >foo && git add foo) &&\n'> 
          <'\tgit status >output &&\n'> <'\ttest_i18ngrep "modified:   sub (modified content)" output\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status with added file in submodule (porcelain)'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git reset --hard && echo >foo && git add foo) &&\n'> 
          <'\tgit status --porcelain >output &&\n'> <'\tdiff output - <<-\\EOF\n'> <'\t M sub\n'> <'\tEOF\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status with untracked file in submodule'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git reset --hard) &&\n'> <'\techo "content" >sub/new-file &&\n'> 
          <'\tgit status >output &&\n'> <'\ttest_i18ngrep "modified:   sub (untracked content)" output\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status -uno with untracked file in submodule'>)} 
      {
        (SQ <'\n'> <'\tgit status -uno >output &&\n'> <'\ttest_i18ngrep "^nothing to commit" output\n'>)
      }
    )
    (C {(test_expect_success)} {(SQ <'status with untracked file in submodule (porcelain)'>)} 
      {
        (SQ <'\n'> <'\tgit status --porcelain >output &&\n'> <'\tdiff output - <<-\\EOF\n'> 
          <'\t M sub\n'> <'\tEOF\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status with added and untracked file in submodule'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git reset --hard && echo >foo && git add foo) &&\n'> 
          <'\techo "content" >sub/new-file &&\n'> <'\tgit status >output &&\n'> 
          <'\ttest_i18ngrep "modified:   sub (modified content, untracked content)" output\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status with added and untracked file in submodule (porcelain)'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git reset --hard && echo >foo && git add foo) &&\n'> 
          <'\techo "content" >sub/new-file &&\n'> <'\tgit status --porcelain >output &&\n'> <'\tdiff output - <<-\\EOF\n'> <'\t M sub\n'> <'\tEOF\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status with modified file in modified submodule'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git reset --hard) &&\n'> <'\trm sub/new-file &&\n'> 
          <'\t(cd sub && echo "next change" >foo && git commit -m "next change" foo) &&\n'> <'\techo "changed" >sub/foo &&\n'> <'\tgit status >output &&\n'> 
          <'\ttest_i18ngrep "modified:   sub (new commits, modified content)" output\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status with modified file in modified submodule (porcelain)'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git reset --hard) &&\n'> <'\techo "changed" >sub/foo &&\n'> 
          <'\tgit status --porcelain >output &&\n'> <'\tdiff output - <<-\\EOF\n'> <'\t M sub\n'> <'\tEOF\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status with added file in modified submodule'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git reset --hard && echo >foo && git add foo) &&\n'> 
          <'\tgit status >output &&\n'> <'\ttest_i18ngrep "modified:   sub (new commits, modified content)" output\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status with added file in modified submodule (porcelain)'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git reset --hard && echo >foo && git add foo) &&\n'> 
          <'\tgit status --porcelain >output &&\n'> <'\tdiff output - <<-\\EOF\n'> <'\t M sub\n'> <'\tEOF\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status with untracked file in modified submodule'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git reset --hard) &&\n'> <'\techo "content" >sub/new-file &&\n'> 
          <'\tgit status >output &&\n'> <'\ttest_i18ngrep "modified:   sub (new commits, untracked content)" output\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status with untracked file in modified submodule (porcelain)'>)} 
      {
        (SQ <'\n'> <'\tgit status --porcelain >output &&\n'> <'\tdiff output - <<-\\EOF\n'> 
          <'\t M sub\n'> <'\tEOF\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status with added and untracked file in modified submodule'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git reset --hard && echo >foo && git add foo) &&\n'> 
          <'\techo "content" >sub/new-file &&\n'> <'\tgit status >output &&\n'> 
          <
'\ttest_i18ngrep "modified:   sub (new commits, modified content, untracked content)" output\n'
          >
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ <'status with added and untracked file in modified submodule (porcelain)'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git reset --hard && echo >foo && git add foo) &&\n'> 
          <'\techo "content" >sub/new-file &&\n'> <'\tgit status --porcelain >output &&\n'> <'\tdiff output - <<-\\EOF\n'> <'\t M sub\n'> <'\tEOF\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'setup .git file for sub'>)} 
      {
        (SQ <'\n'> <'\t(cd sub &&\n'> <'\t rm -f new-file\n'> <'\t REAL="$(pwd)/../.real" &&\n'> 
          <'\t mv .git "$REAL"\n'> <'\t echo "gitdir: $REAL" >.git) &&\n'> <'\t echo .real >>.gitignore &&\n'> 
          <'\t git commit -m "added .real to .gitignore" .gitignore\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'status with added file in modified submodule with .git file'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git reset --hard && echo >foo && git add foo) &&\n'> 
          <'\tgit status >output &&\n'> <'\ttest_i18ngrep "modified:   sub (new commits, modified content)" output\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'rm submodule contents'>)} 
      {(SQ <'\n'> <'\trm -rf sub/* sub/.git\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'status clean (empty submodule dir)'>)} 
      {(SQ <'\n'> <'\tgit status >output &&\n'> <'\ttest_i18ngrep "nothing to commit" output\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'status -a clean (empty submodule dir)'>)} 
      {
        (SQ <'\n'> <'\ttest_must_fail git commit --dry-run -a >output &&\n'> 
          <'\ttest_i18ngrep "nothing to commit" output\n'>
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(status_expect)} spids:[483])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: {('AA .gitmodules\n') ('A  sub1\n')}
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [486]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'status with merge conflict in .gitmodules'>)} 
      {
        (SQ <'\n'> <'\tgit clone . super &&\n'> <'\ttest_create_repo_with_commit sub1 &&\n'> 
          <'\ttest_tick &&\n'> <'\ttest_create_repo_with_commit sub2 &&\n'> <'\t(\n'> <'\t\tcd super &&\n'> 
          <'\t\tprev=$(git rev-parse HEAD) &&\n'> <'\t\tgit checkout -b add_sub1 &&\n'> <'\t\tgit submodule add ../sub1 &&\n'> 
          <'\t\tgit commit -m "add sub1" &&\n'> <'\t\tgit checkout -b add_sub2 $prev &&\n'> <'\t\tgit submodule add ../sub2 &&\n'> 
          <'\t\tgit commit -m "add sub2" &&\n'> <'\t\tgit checkout -b merge_conflict_gitmodules &&\n'> <'\t\ttest_must_fail git merge add_sub1 &&\n'> 
          <'\t\tgit status -s >../status_actual 2>&1\n'> <'\t) &&\n'> <'\ttest_cmp status_actual status_expect\n'>
        )
      }
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:sha1_merge_sub1)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (AndOr
                        children: [(C {(cd)} {(sub1)}) (C {(git)} {(rev-parse)} {(HEAD)})]
                        op_id: Op_DAmp
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [521 533]
              )
            }
          spids: [520]
        )
      ]
      spids: [520]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:sha1_merge_sub2)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (AndOr
                        children: [(C {(cd)} {(sub2)}) (C {(git)} {(rev-parse)} {(HEAD)})]
                        op_id: Op_DAmp
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [536 548]
              )
            }
          spids: [535]
        )
      ]
      spids: [535]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:short_sha1_merge_sub1)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (AndOr
                        children: [(C {(cd)} {(sub1)}) (C {(git)} {(rev-parse)} {(--short)} {(HEAD)})]
                        op_id: Op_DAmp
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [551 565]
              )
            }
          spids: [550]
        )
      ]
      spids: [550]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:short_sha1_merge_sub2)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (AndOr
                        children: [(C {(cd)} {(sub2)}) (C {(git)} {(rev-parse)} {(--short)} {(HEAD)})]
                        op_id: Op_DAmp
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [568 582]
              )
            }
          spids: [567]
        )
      ]
      spids: [567]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(diff_expect)} spids:[586])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: 
            {('diff --cc .gitmodules\n') ('index badaa4c,44f999a..0000000\n') ('--- a/.gitmodules\n') 
              ('+++ b/.gitmodules\n') ('@@@ -1,3 -1,3 +1,9 @@@\n') ('++<<<<<<< HEAD\n') (' +[submodule "sub2"]\n') (' +\tpath = sub2\n') 
              (' +\turl = ../sub2\n') ('++=======\n') ('+ [submodule "sub1"]\n') ('+ \tpath = sub1\n') ('+ \turl = ../sub1\n') 
              ('++>>>>>>> add_sub1\n')
            }
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [589]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(diff_submodule_expect)} spids:[596])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: 
            {('diff --cc .gitmodules\n') ('index badaa4c,44f999a..0000000\n') ('--- a/.gitmodules\n') 
              ('+++ b/.gitmodules\n') ('@@@ -1,3 -1,3 +1,9 @@@\n') ('++<<<<<<< HEAD\n') (' +[submodule "sub2"]\n') (' +\tpath = sub2\n') 
              (' +\turl = ../sub2\n') ('++=======\n') ('+ [submodule "sub1"]\n') ('+ \tpath = sub1\n') ('+ \turl = ../sub1\n') 
              ('++>>>>>>> add_sub1\n')
            }
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [599]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'diff with merge conflict in .gitmodules'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd super &&\n'> <'\t\tgit diff >../diff_actual 2>&1\n'> <'\t) &&\n'> 
          <'\ttest_cmp diff_actual diff_expect\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'diff --submodule with merge conflict in .gitmodules'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd super &&\n'> 
          <'\t\tgit diff --submodule >../diff_submodule_actual 2>&1\n'> <'\t) &&\n'> <'\ttest_cmp diff_submodule_actual diff_submodule_expect\n'>
        )
      }
    )
    (C {(test_done)})
  ]
)