(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'Test repository version check'>)}
          spids: [13]
        )
      ]
      spids: [13]
    )
    (C {(.)} {(./test-lib.sh)})
    (C {(test_expect_success)} {(SQ <setup>)} 
      {
        (SQ <'\n'> <'\tcat >test.patch <<-\\EOF &&\n'> <'\tdiff --git a/test.txt b/test.txt\n'> 
          <'\tnew file mode 100644\n'> <'\t--- /dev/null\n'> <'\t+++ b/test.txt\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+123\n'> <'\tEOF\n'> <'\n'> 
          <'\ttest_create_repo "test" &&\n'> <'\ttest_create_repo "test2" &&\n'> 
          <'\tgit config --file=test2/.git/config core.repositoryformatversion 99\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'gitdir selection on normal repos'>)} 
      {
        (SQ <'\n'> <'\techo 0 >expect &&\n'> <'\tgit config core.repositoryformatversion >actual &&\n'> 
          <'\tgit -C test config core.repositoryformatversion >actual2 &&\n'> <'\ttest_cmp expect actual &&\n'> <'\ttest_cmp expect actual2\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'gitdir selection on unsupported repo'>)} 
      {
        (SQ <'\n'> <'\t# Make sure it would stop at test2, not trash\n'> 
          <'\ttest_expect_code 1 git -C test2 config core.repositoryformatversion >actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'gitdir not required mode'>)} 
      {
        (SQ <'\n'> <'\tgit apply --stat test.patch &&\n'> 
          <'\tgit -C test apply --stat ../test.patch &&\n'> <'\tgit -C test2 apply --stat ../test.patch\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'gitdir required mode'>)} 
      {
        (SQ <'\n'> <'\tgit apply --check --index test.patch &&\n'> 
          <'\tgit -C test apply --check --index ../test.patch &&\n'> <'\ttest_must_fail git -C test2 apply --check --index ../test.patch\n'>
        )
      }
    )
    (FuncDef
      name: check_allow
      body: 
        (BraceGroup
          children: [
            (AndOr
              ops: [Op_DAmp Op_DAmp]
              children: [
                (SimpleCommand
                  words: [{(git)} {(rev-parse)} {(--git-dir)}]
                  redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(actual)} spids:[118])]
                )
                (SimpleCommand
                  words: [{(echo)} {(.git)}]
                  redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(expect)} spids:[128])]
                )
                (C {(test_cmp)} {(expect)} {(actual)})
              ]
            )
          ]
          spids: [109]
        )
      spids: [104 108]
    )
    (FuncDef
      name: check_abort
      body: 
        (BraceGroup
          children: [(C {(test_must_fail)} {(git)} {(rev-parse)} {(--git-dir)})]
          spids: [148]
        )
      spids: [143 147]
    )
    (FuncDef
      name: mkconfig
      body: 
        (BraceGroup
          children: [
            (AndOr
              ops: [Op_DAmp Op_DAmp Op_DAmp]
              children: [
                (C {(echo)} {(SQ <'[core]'>)})
                (C {(echo)} {(DQ ('repositoryformatversion = ') ($ VSub_Number '$1'))})
                (C {(shift)})
                (If
                  arms: [
                    (if_arm
                      cond: [
                        (Sentence
                          child: (C {(test)} {($ VSub_Pound '$#')} {(-gt)} {(0)})
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (AndOr
                          ops: [Op_DAmp]
                          children: [
                            (C {(echo)} {(SQ <'[extensions]'>)})
                            (ForEach
                              iter_name: i
                              iter_words: [{(DQ ($ VSub_At '$@'))}]
                              do_arg_iter: F
                              body: 
                                (DoGroup
                                  children: [(C {(echo)} {(DQ ($ VSub_Name '$i'))})]
                                  spids: [235 245]
                                )
                              spids: [229 233]
                            )
                          ]
                        )
                      ]
                      spids: [16777215 212]
                    )
                  ]
                  spids: [16777215 248]
                )
              ]
            )
          ]
          spids: [173]
        )
      spids: [168 172]
    )
    (While
      cond: [
        (Sentence
          child: (C {(read)} {(outcome)} {(version)} {(extensions)})
          terminator: <Op_Semi ';'>
        )
      ]
      body: 
        (DoGroup
          children: [
            (C {(test_expect_success)} 
              {
                (DQ ($ VSub_Name '$outcome') (' version=') ($ VSub_Name '$version') (' ') 
                  ($ VSub_Name '$extensions')
                )
              } 
              {
                (DQ ('\n') ('\t\tmkconfig ') ($ VSub_Name '$version') (' ') ($ VSub_Name '$extensions') 
                  (' >.git/config &&\n') ('\t\tcheck_') (${ VSub_Name outcome) ('\n') ('\t')
                )
              }
            )
          ]
          spids: [264 292]
        )
      redirects: [
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: 
            {('allow 0\n') ('allow 1\n') ('allow 1 noop\n') ('abort 1 no-such-extension\n') 
              ('allow 0 no-such-extension\n')
            }
          do_expansion: False
          here_end: EOF
          was_filled: T
          spids: [294]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'precious-objects allowed'>)} 
      {(SQ <'\n'> <'\tmkconfig 1 preciousObjects >.git/config &&\n'> <'\tcheck_allow\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'precious-objects blocks destructive repack'>)} 
      {(SQ <'\n'> <'\ttest_must_fail git repack -ad\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'other repacks are OK'>)} 
      {(SQ <'\n'> <'\ttest_commit foo &&\n'> <'\tgit repack\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'precious-objects blocks prune'>)} 
      {(SQ <'\n'> <'\ttest_must_fail git prune\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'gc runs without complaint'>)} {(SQ <'\n'> <'\tgit gc\n'>)})
    (C {(test_done)})
  ]
)