(command.CommandList
  children: [
    (command.ShAssignment
      left: <Id.Lit_VarLike 'test_description='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'test_description='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'test clone --reference'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./test-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'base_dir='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'base_dir='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'base_dir='> name:base_dir)
          op: assign_op.Equal
          rhs: 
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <pwd>
                    more_env: []
                    words: [{<pwd>}]
                    redirects: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'U='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'U='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'U='> name:U)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName base_dir) <'/UPLOAD_LOG'>}
        )
      ]
      redirects: []
    )
    (command.ShFunction
      name_tok: <commit_in>
      name: commit_in
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Subshell
              left: <Id.Op_LParen _>
              child: 
                (command.AndOr
                  children: [
                    (command.Simple
                      blame_tok: <cd>
                      more_env: []
                      words: [{<cd>} {(DQ ($ Id.VSub_Number 1))}]
                      redirects: []
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <echo>
                      more_env: []
                      words: [{<echo>} {(DQ ($ Id.VSub_Number 2))}]
                      redirects: [
                        (Redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {(DQ ($ Id.VSub_Number 2))}
                        )
                      ]
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <git>
                      more_env: []
                      words: [{<git>} {<add>} {(DQ ($ Id.VSub_Number 2))}]
                      redirects: []
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <git>
                      more_env: []
                      words: [{<git>} {<commit>} {<-m>} {(DQ ($ Id.VSub_Number 2))}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  ops: [<Id.Op_DAmp _> <Id.Op_DAmp _> <Id.Op_DAmp _>]
                )
              right: <Id.Right_Subshell _>
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <test_objcount>
      name: test_objcount
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.AndOr
              children: [
                (command.Simple
                  blame_tok: <echo>
                  more_env: []
                  words: [{<echo>} {(DQ ($ Id.VSub_Number 2))}]
                  redirects: [(Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})]
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <git>
                  more_env: []
                  words: [{<git>} {<-C>} {(DQ ($ Id.VSub_Number 1))} {<count-objects>}]
                  redirects: [
                    (Redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {<actual.raw>}
                    )
                  ]
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <cut>
                  more_env: []
                  words: [{<cut>} {<-d> (SQ <' '>)} {<-f1>}]
                  redirects: [
                    (Redir
                      op: <Id.Redir_Less '<'>
                      loc: (redir_loc.Fd fd:0)
                      arg: {<actual.raw>}
                    )
                    (Redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {<actual>}
                    )
                  ]
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <test_cmp>
                  more_env: []
                  words: [{<test_cmp>} {<expect>} {<actual>}]
                  redirects: []
                  do_fork: T
                )
              ]
              ops: [<Id.Op_DAmp _> <Id.Op_DAmp _> <Id.Op_DAmp _>]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'preparing first repository'>)}
        {(SQ <'\n'> <'\ttest_create_repo A &&\n'> <'\tcommit_in A file1\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'preparing second repository'>)}
        {
          (SQ <'\n'> <'\tgit clone A B &&\n'> <'\tcommit_in B file2 &&\n'> 
            <'\tgit -C B repack -ad &&\n'> <'\tgit -C B prune\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'cloning with reference (-l -s)'>)}
        {(SQ <'\n'> <'\tgit clone -l -s --reference B A C\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'existence of info/alternates'>)}
        {(SQ <'\n'> <'\ttest_line_count = 2 C/.git/objects/info/alternates\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'pulling from reference'>)}
        {(SQ <'\n'> <'\tgit -C C pull ../B master\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'that reference gets used'>)}
        {(SQ <'\n'> <'\ttest_objcount C 0\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'cloning with reference (no -l -s)'>)}
        {(SQ <'\n'> <'\tGIT_TRACE_PACKET=$U.D git clone --reference B "file://$(pwd)/A" D\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'fetched no objects'>)}
        {(SQ <'\n'> <'\ttest -s "$U.D" &&\n'> <'\t! grep " want" "$U.D"\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'existence of info/alternates'>)}
        {(SQ <'\n'> <'\ttest_line_count = 1 D/.git/objects/info/alternates\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'pulling from reference'>)}
        {(SQ <'\n'> <'\tgit -C D pull ../B master\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'that reference gets used'>)}
        {(SQ <'\n'> <'\ttest_objcount D 0\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'updating origin'>)}
        {
          (SQ <'\n'> <'\tcommit_in A file3 &&\n'> <'\tgit -C A repack -ad &&\n'> <'\tgit -C A prune\n'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'pulling changes from origin'>)}
        {(SQ <'\n'> <'\tgit -C C pull origin\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'that alternate to origin gets used'>)}
        {(SQ <'\n'> <'\ttest_objcount C 2\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'pulling changes from origin'>)}
        {(SQ <'\n'> <'\tgit -C D pull origin\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'check objects expected to exist locally'>)}
        {(SQ <'\n'> <'\ttest_objcount D 5\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'preparing alternate repository #1'>)}
        {(SQ <'\n'> <'\ttest_create_repo F &&\n'> <'\tcommit_in F file1\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'cloning alternate repo #2 and adding changes to repo #1'>)}
        {(SQ <'\n'> <'\tgit clone F G &&\n'> <'\tcommit_in F file2\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'cloning alternate repo #1, using #2 as reference'>)}
        {(SQ <'\n'> <'\tgit clone --reference G F H\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'cloning with reference being subset of source (-l -s)'>)}
        {(SQ <'\n'> <'\tgit clone -l -s --reference A B E\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'cloning with multiple references drops duplicates'>)}
        {
          (SQ <'\n'> <'\tgit clone -s --reference B --reference A --reference B A dups &&\n'> 
            <'\ttest_line_count = 2 dups/.git/objects/info/alternates\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'clone with reference from a tagged repository'>)}
        {
          (SQ <'\n'> <'\t(\n'> <'\t\tcd A && git tag -a -m tagged HEAD\n'> <'\t) &&\n'> 
            <'\tgit clone --reference=A A I\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'prepare branched repository'>)}
        {
          (SQ <'\n'> <'\tgit clone A J &&\n'> <'\t(\n'> <'\t\tcd J &&\n'> 
            <'\t\tgit checkout -b other master^ &&\n'> <'\t\techo other >otherfile &&\n'> <'\t\tgit add otherfile &&\n'> <'\t\tgit commit -m other &&\n'> 
            <'\t\tgit checkout master\n'> <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'fetch with incomplete alternates'>)}
        {
          (SQ <'\n'> <'\tgit init K &&\n'> 
            <'\techo "$base_dir/A/.git/objects" >K/.git/objects/info/alternates &&\n'> <'\t(\n'> <'\t\tcd K &&\n'> <'\t\tgit remote add J "file://$base_dir/J" &&\n'> 
            <'\t\tGIT_TRACE_PACKET=$U.K git fetch J\n'> <'\t) &&\n'> 
            <
'\tmaster_object=$(cd A && git for-each-ref --format="%(objectname)" refs/heads/master) &&\n'
            > <'\ttest -s "$U.K" &&\n'> <'\t! grep " want $master_object" "$U.K" &&\n'> 
            <
'\ttag_object=$(cd A && git for-each-ref --format="%(objectname)" refs/tags/HEAD) &&\n'
            > <'\t! grep " want $tag_object" "$U.K"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'clone using repo with gitfile as a reference'>)}
        {
          (SQ <'\n'> <'\tgit clone --separate-git-dir=L A M &&\n'> 
            <'\tgit clone --reference=M A N &&\n'> <'\techo "$base_dir/L/objects" >expected &&\n'> 
            <'\ttest_cmp expected "$base_dir/N/.git/objects/info/alternates"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'clone using repo pointed at by gitfile as reference'>)}
        {
          (SQ <'\n'> <'\tgit clone --reference=M/.git A O &&\n'> 
            <'\techo "$base_dir/L/objects" >expected &&\n'> <'\ttest_cmp expected "$base_dir/O/.git/objects/info/alternates"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'clone and dissociate from reference'>)}
        {
          (SQ <'\n'> <'\tgit init P &&\n'> <'\t(\n'> <'\t\tcd P &&\ttest_commit one\n'> <'\t) &&\n'> 
            <'\tgit clone P Q &&\n'> <'\t(\n'> <'\t\tcd Q && test_commit two\n'> <'\t) &&\n'> 
            <'\tgit clone --no-local --reference=P Q R &&\n'> <'\tgit clone --no-local --reference=P --dissociate Q S &&\n'> 
            <'\t# removing the reference P would corrupt R but not S\n'> <'\trm -fr P &&\n'> <'\ttest_must_fail git -C R fsck &&\n'> <'\tgit -C S fsck\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'clone, dissociate from partial reference and repack'>)}
        {
          (SQ <'\n'> <'\trm -fr P Q R &&\n'> <'\tgit init P &&\n'> <'\t(\n'> <'\t\tcd P &&\n'> 
            <'\t\ttest_commit one &&\n'> <'\t\tgit repack &&\n'> <'\t\ttest_commit two &&\n'> <'\t\tgit repack\n'> <'\t) &&\n'> 
            <'\tgit clone --bare P Q &&\n'> <'\t(\n'> <'\t\tcd P &&\n'> <'\t\tgit checkout -b second &&\n'> <'\t\ttest_commit three &&\n'> 
            <'\t\tgit repack\n'> <'\t) &&\n'> <'\tgit clone --bare --dissociate --reference=P Q R &&\n'> 
            <'\tls R/objects/pack/*.pack >packs.txt &&\n'> <'\ttest_line_count = 1 packs.txt\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'clone, dissociate from alternates'>)}
        {
          (SQ <'\n'> <'\trm -fr A B C &&\n'> <'\ttest_create_repo A &&\n'> <'\tcommit_in A file1 &&\n'> 
            <'\tgit clone --reference=A A B &&\n'> <'\ttest_line_count = 1 B/.git/objects/info/alternates &&\n'> 
            <'\tgit clone --local --dissociate B C &&\n'> <'\t! test -f C/.git/objects/info/alternates &&\n'> <'\t( cd C && git fsck )\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)