(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {<clone>}
          spids: [4]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:X)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [13]
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<test_have_prereq>} {<Id.KW_Bang '!'> <MINGW>})
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:X)
              op: assign_op.Equal
              rhs: {<.exe>}
              spids: [22]
            )
          ]
        )
      ]
    )
    (C {<test_expect_success>} {<setup>} 
      {
        (SQ <'\n'> <'\n'> <'\trm -fr .git &&\n'> <'\ttest_create_repo src &&\n'> <'\t(\n'> 
          <'\t\tcd src &&\n'> <'\t\t>file &&\n'> <'\t\tgit add file &&\n'> <'\t\tgit commit -m initial &&\n'> 
          <'\t\techo 1 >file &&\n'> <'\t\tgit add file &&\n'> <'\t\tgit commit -m updated\n'> <'\t)\n'> <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone with excess parameters (1)'>)} 
      {
        (SQ <'\n'> <'\n'> <'\trm -fr dst &&\n'> <'\ttest_must_fail git clone -n src dst junk\n'> <'\n'>)
      }
    )
    (C {<test_expect_success>} {(SQ <'clone with excess parameters (2)'>)} 
      {
        (SQ <'\n'> <'\n'> <'\trm -fr dst &&\n'> 
          <'\ttest_must_fail git clone -n "file://$(pwd)/src" dst junk\n'> <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {<C_LOCALE_OUTPUT>} {(SQ <'output from clone'>)} 
      {
        (SQ <'\n'> <'\trm -fr dst &&\n'> <'\tgit clone -n "file://$(pwd)/src" dst >output 2>&1 &&\n'> 
          <'\ttest $(grep Clon output | wc -l) = 1\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone does not keep pack'>)} 
      {
        (SQ <'\n'> <'\n'> <'\trm -fr dst &&\n'> <'\tgit clone -n "file://$(pwd)/src" dst &&\n'> 
          <'\t! test -f dst/file &&\n'> <'\t! (echo dst/.git/objects/pack/pack-* | grep "\\.keep")\n'> <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone checks out files'>)} 
      {
        (SQ <'\n'> <'\n'> <'\trm -fr dst &&\n'> <'\tgit clone src dst &&\n'> <'\ttest -f dst/file\n'> 
          <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone respects GIT_WORK_TREE'>)} 
      {
        (SQ <'\n'> <'\n'> <'\tGIT_WORK_TREE=worktree git clone src bare &&\n'> 
          <'\ttest -f bare/config &&\n'> <'\ttest -f worktree/file\n'> <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone from hooks'>)} 
      {
        (SQ <'\n'> <'\n'> <'\ttest_create_repo r0 &&\n'> <'\tcd r0 &&\n'> <'\ttest_commit initial &&\n'> 
          <'\tcd .. &&\n'> <'\tgit init r1 &&\n'> <'\tcd r1 &&\n'> <'\tcat >.git/hooks/pre-commit <<-\\EOF &&\n'> <'\t#!/bin/sh\n'> 
          <'\tgit clone ../r0 ../r2\n'> <'\texit 1\n'> <'\tEOF\n'> <'\tchmod u+x .git/hooks/pre-commit &&\n'> <'\t: >file &&\n'> 
          <'\tgit add file &&\n'> <'\ttest_must_fail git commit -m invoke-hook &&\n'> <'\tcd .. &&\n'> 
          <'\ttest_cmp r0/.git/HEAD r2/.git/HEAD &&\n'> <'\ttest_cmp r0/initial.t r2/initial.t\n'> <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone creates intermediate directories'>)} 
      {
        (SQ <'\n'> <'\n'> <'\tgit clone src long/path/to/dst &&\n'> 
          <'\ttest -f long/path/to/dst/file\n'> <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone creates intermediate directories for bare repo'>)} 
      {
        (SQ <'\n'> <'\n'> <'\tgit clone --bare src long/path/to/bare/dst &&\n'> 
          <'\ttest -f long/path/to/bare/dst/config\n'> <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone --mirror'>)} 
      {
        (SQ <'\n'> <'\n'> <'\tgit clone --mirror src mirror &&\n'> <'\ttest -f mirror/HEAD &&\n'> 
          <'\ttest ! -f mirror/file &&\n'> <'\tFETCH="$(cd mirror && git config remote.origin.fetch)" &&\n'> 
          <'\ttest "+refs/*:refs/*" = "$FETCH" &&\n'> <'\tMIRROR="$(cd mirror && git config --bool remote.origin.mirror)" &&\n'> 
          <'\ttest "$MIRROR" = true\n'> <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone --mirror with detached HEAD'>)} 
      {
        (SQ <'\n'> <'\n'> 
          <'\t( cd src && git checkout HEAD^ && git rev-parse HEAD >../expected ) &&\n'> <'\tgit clone --mirror src mirror.detached &&\n'> <'\t( cd src && git checkout - ) &&\n'> 
          <'\tGIT_DIR=mirror.detached git rev-parse HEAD >actual &&\n'> <'\ttest_cmp expected actual\n'> <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone --bare with detached HEAD'>)} 
      {
        (SQ <'\n'> <'\n'> 
          <'\t( cd src && git checkout HEAD^ && git rev-parse HEAD >../expected ) &&\n'> <'\tgit clone --bare src bare.detached &&\n'> <'\t( cd src && git checkout - ) &&\n'> 
          <'\tGIT_DIR=bare.detached git rev-parse HEAD >actual &&\n'> <'\ttest_cmp expected actual\n'> <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone --bare names the local repository <name>.git'>)} 
      {(SQ <'\n'> <'\n'> <'\tgit clone --bare src &&\n'> <'\ttest -d src.git\n'> <'\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'clone --mirror does not repeat tags'>)} 
      {
        (SQ <'\n'> <'\n'> <'\t(cd src &&\n'> <'\t git tag some-tag HEAD) &&\n'> 
          <'\tgit clone --mirror src mirror2 &&\n'> <'\t(cd mirror2 &&\n'> <'\t git show-ref 2> clone.err > clone.out) &&\n'> 
          <'\ttest_must_fail grep Duplicate mirror2/clone.err &&\n'> <'\tgrep some-tag mirror2/clone.out\n'> <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone to destination with trailing /'>)} 
      {
        (SQ <'\n'> <'\n'> <'\tgit clone src target-1/ &&\n'> 
          <'\tT=$( cd target-1 && git rev-parse HEAD ) &&\n'> <'\tS=$( cd src && git rev-parse HEAD ) &&\n'> <'\ttest "$T" = "$S"\n'> <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone to destination with extra trailing /'>)} 
      {
        (SQ <'\n'> <'\n'> <'\tgit clone src target-2/// &&\n'> 
          <'\tT=$( cd target-2 && git rev-parse HEAD ) &&\n'> <'\tS=$( cd src && git rev-parse HEAD ) &&\n'> <'\ttest "$T" = "$S"\n'> <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone to an existing empty directory'>)} 
      {
        (SQ <'\n'> <'\tmkdir target-3 &&\n'> <'\tgit clone src target-3 &&\n'> 
          <'\tT=$( cd target-3 && git rev-parse HEAD ) &&\n'> <'\tS=$( cd src && git rev-parse HEAD ) &&\n'> <'\ttest "$T" = "$S"\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone to an existing non-empty directory'>)} 
      {
        (SQ <'\n'> <'\tmkdir target-4 &&\n'> <'\t>target-4/Fakefile &&\n'> 
          <'\ttest_must_fail git clone src target-4\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone to an existing path'>)} 
      {(SQ <'\n'> <'\t>target-5 &&\n'> <'\ttest_must_fail git clone src target-5\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'clone a void'>)} 
      {
        (SQ <'\n'> <'\tmkdir src-0 &&\n'> <'\t(\n'> <'\t\tcd src-0 && git init\n'> <'\t) &&\n'> 
          <'\tgit clone "file://$(pwd)/src-0" target-6 2>err-6 &&\n'> <'\t! grep "fatal:" err-6 &&\n'> <'\t(\n'> <'\t\tcd src-0 && test_commit A\n'> <'\t) &&\n'> 
          <'\tgit clone "file://$(pwd)/src-0" target-7 2>err-7 &&\n'> <'\t! grep "fatal:" err-7 &&\n'> <'\t# There is no reason to insist they are bit-for-bit\n'> 
          <'\t# identical, but this test should suffice for now.\n'> <'\ttest_cmp target-6/.git/config target-7/.git/config\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone respects global branch.autosetuprebase'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\ttest_config="$HOME/.gitconfig" &&\n'> 
          <'\t\tgit config -f "$test_config" branch.autosetuprebase remote &&\n'> <'\t\trm -fr dst &&\n'> <'\t\tgit clone src dst &&\n'> <'\t\tcd dst &&\n'> 
          <'\t\tactual="z$(git config branch.master.rebase)" &&\n'> <'\t\ttest ztrue = $actual\n'> <'\t)\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'respect url-encoding of file://'>)} 
      {
        (SQ <'\n'> <'\tgit init x+y &&\n'> <'\tgit clone "file://$PWD/x+y" xy-url-1 &&\n'> 
          <'\tgit clone "file://$PWD/x%2By" xy-url-2\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'do not query-string-decode + in URLs'>)} 
      {
        (SQ <'\n'> <'\trm -rf x+y &&\n'> <'\tgit init "x y" &&\n'> 
          <'\ttest_must_fail git clone "file://$PWD/x+y" xy-no-plus\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'do not respect url-encoding of non-url path'>)} 
      {
        (SQ <'\n'> <'\tgit init x+y &&\n'> <'\ttest_must_fail git clone x%2By xy-regular &&\n'> 
          <'\tgit clone x+y xy-regular\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone separate gitdir'>)} 
      {
        (SQ <'\n'> <'\trm -rf dst &&\n'> <'\tgit clone --separate-git-dir realgitdir src dst &&\n'> 
          <'\ttest -d realgitdir/refs\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone separate gitdir: output'>)} 
      {
        (SQ <'\n'> <'\techo "gitdir: $(pwd)/realgitdir" >expected &&\n'> 
          <'\ttest_cmp expected dst/.git\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone from .git file'>)} 
      {(SQ <'\n'> <'\tgit clone dst/.git dst2\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'fetch from .git gitfile'>)} 
      {(SQ <'\n'> <'\t(\n'> <'\t\tcd dst2 &&\n'> <'\t\tgit fetch ../dst/.git\n'> <'\t)\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'fetch from gitfile parent'>)} 
      {(SQ <'\n'> <'\t(\n'> <'\t\tcd dst2 &&\n'> <'\t\tgit fetch ../dst\n'> <'\t)\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'clone separate gitdir where target already exists'>)} 
      {
        (SQ <'\n'> <'\trm -rf dst &&\n'> 
          <'\ttest_must_fail git clone --separate-git-dir realgitdir src dst\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone --reference from original'>)} 
      {
        (SQ <'\n'> <'\tgit clone --shared --bare src src-1 &&\n'> <'\tgit clone --bare src src-2 &&\n'> 
          <'\tgit clone --reference=src-2 --bare src-1 target-8 &&\n'> <'\tgrep /src-2/ target-8/objects/info/alternates\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone with more than one --reference'>)} 
      {
        (SQ <'\n'> <'\tgit clone --bare src src-3 &&\n'> <'\tgit clone --bare src src-4 &&\n'> 
          <'\tgit clone --reference=src-3 --reference=src-4 src target-9 &&\n'> <'\tgrep /src-3/ target-9/.git/objects/info/alternates &&\n'> 
          <'\tgrep /src-4/ target-9/.git/objects/info/alternates\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone from original with relative alternate'>)} 
      {
        (SQ <'\n'> <'\tmkdir nest &&\n'> <'\tgit clone --bare src nest/src-5 &&\n'> 
          <'\techo ../../../src/.git/objects >nest/src-5/objects/info/alternates &&\n'> <'\tgit clone --bare nest/src-5 target-10 &&\n'> 
          <'\tgrep /src/\\\\.git/objects target-10/objects/info/alternates\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone checking out a tag'>)} 
      {
        (SQ <'\n'> <'\tgit clone --branch=some-tag src dst.tag &&\n'> 
          <'\tGIT_DIR=src/.git git rev-parse some-tag >expected &&\n'> <'\ttest_cmp expected dst.tag/.git/HEAD &&\n'> 
          <'\tGIT_DIR=dst.tag/.git git config remote.origin.fetch >fetch.actual &&\n'> <'\techo "+refs/heads/*:refs/remotes/origin/*" >fetch.expected &&\n'> 
          <'\ttest_cmp fetch.expected fetch.actual\n'>
        )
      }
    )
    (command.ShFunction
      name: setup_ssh_wrapper
      body: 
        (BraceGroup
          children: [
            (C {<test_expect_success>} {(SQ <'setup ssh wrapper'>)} 
              {
                (SQ <'\n'> <'\t\tcp "$GIT_BUILD_DIR/t/helper/test-fake-ssh$X" \\\n'> 
                  <'\t\t\t"$TRASH_DIRECTORY/ssh-wrapper$X" &&\n'> <'\t\tGIT_SSH="$TRASH_DIRECTORY/ssh-wrapper$X" &&\n'> <'\t\texport GIT_SSH &&\n'> 
                  <'\t\texport TRASH_DIRECTORY &&\n'> <'\t\t>"$TRASH_DIRECTORY"/ssh-output\n'> <'\t'>
                )
              }
            )
          ]
        )
    )
    (command.ShFunction
      name: copy_ssh_wrapper_as
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {<cp>} 
                  {
                    (DQ ($ Id.VSub_DollarName '$TRASH_DIRECTORY') <'/ssh-wrapper'> 
                      ($ Id.VSub_DollarName '$X')
                    )
                  } 
                  {
                    (DQ 
                      (braced_var_sub
                        token: <Id.VSub_Number 1>
                        suffix_op: 
                          (suffix_op.Unary
                            tok: <Id.VOp1_Percent '%'>
                            arg_word: {($ Id.VSub_DollarName '$X')}
                          )
                      ) ($ Id.VSub_DollarName '$X')
                    )
                  }
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:GIT_SSH)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (DQ 
                            (braced_var_sub
                              token: <Id.VSub_Number 1>
                              suffix_op: 
                                (suffix_op.Unary
                                  tok: <Id.VOp1_Percent '%'>
                                  arg_word: {($ Id.VSub_DollarName '$X')}
                                )
                            ) ($ Id.VSub_DollarName '$X')
                          )
                        }
                      spids: [661]
                    )
                  ]
                )
                (C {<export>} {<GIT_SSH>})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: expect_ssh
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {<test_when_finished>} 
                  {
                    (SQ <'\n'> <'\t\t(cd "$TRASH_DIRECTORY" && rm -f ssh-expect && >ssh-output)\n'> 
                      <'\t'>
                    )
                  }
                )
                (BraceGroup
                  children: [
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_Pound '$#'))}
                      arms: [
                        (case_arm pat_list:[{<1>}] spids:[712 713 716 -1])
                        (case_arm
                          pat_list: [{<2>}]
                          action: [
                            (C {<echo>} 
                              {
                                (DQ <'ssh: '> ($ Id.VSub_Number '$1') <' git-upload-pack \''> 
                                  ($ Id.VSub_Number '$2') <'\''>
                                )
                              }
                            )
                          ]
                          spids: [719 720 734 -1]
                        )
                        (case_arm
                          pat_list: [{<3>}]
                          action: [
                            (C {<echo>} 
                              {
                                (DQ <'ssh: '> ($ Id.VSub_Number '$1') <' '> ($ Id.VSub_Number '$2') 
                                  <' git-upload-pack \''> ($ Id.VSub_Number '$3') <'\''>
                                )
                              }
                            )
                          ]
                          spids: [737 738 754 -1]
                        )
                        (case_arm
                          pat_list: [{<Id.Lit_Star '*'>}]
                          action: [
                            (C {<echo>} 
                              {
                                (DQ <'ssh: '> ($ Id.VSub_Number '$1') <' '> ($ Id.VSub_Number '$2') 
                                  <' git-upload-pack \''> ($ Id.VSub_Number '$3') <'\' '> ($ Id.VSub_Number '$4')
                                )
                              }
                            )
                          ]
                          spids: [757 758 -1 775]
                        )
                      ]
                    )
                  ]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {(DQ ($ Id.VSub_DollarName '$TRASH_DIRECTORY') <'/ssh-expect'>)}
                    )
                  ]
                )
                (command.Subshell
                  child: 
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<cd>} {(DQ ($ Id.VSub_DollarName '$TRASH_DIRECTORY'))})
                        (C {<test_cmp>} {<ssh-expect>} {<ssh-output>})
                      ]
                    )
                )
              ]
            )
          ]
        )
    )
    (C {<setup_ssh_wrapper>})
    (C {<test_expect_success>} {(SQ <'clone myhost:src uses ssh'>)} 
      {(SQ <'\n'> <'\tgit clone myhost:src ssh-clone &&\n'> <'\texpect_ssh myhost src\n'>)}
    )
    (C {<test_expect_success>} {<Id.KW_Bang '!'> <MINGW> <Id.Lit_Comma ','> <Id.KW_Bang '!'> <CYGWIN>} 
      {(SQ <'clone local path foo:bar'>)} 
      {
        (SQ <'\n'> <'\tcp -R src "foo:bar" &&\n'> <'\tgit clone "foo:bar" foobar &&\n'> 
          <'\texpect_ssh none\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'bracketed hostnames are still ssh'>)} 
      {
        (SQ <'\n'> <'\tgit clone "[myhost:123]:src" ssh-bracket-clone &&\n'> 
          <'\texpect_ssh "-p 123" myhost src\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'uplink is not treated as putty'>)} 
      {
        (SQ <'\n'> <'\tcopy_ssh_wrapper_as "$TRASH_DIRECTORY/uplink" &&\n'> 
          <'\tgit clone "[myhost:123]:src" ssh-bracket-clone-uplink &&\n'> <'\texpect_ssh "-p 123" myhost src\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'plink is treated specially (as putty)'>)} 
      {
        (SQ <'\n'> <'\tcopy_ssh_wrapper_as "$TRASH_DIRECTORY/plink" &&\n'> 
          <'\tgit clone "[myhost:123]:src" ssh-bracket-clone-plink-0 &&\n'> <'\texpect_ssh "-P 123" myhost src\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'plink.exe is treated specially (as putty)'>)} 
      {
        (SQ <'\n'> <'\tcopy_ssh_wrapper_as "$TRASH_DIRECTORY/plink.exe" &&\n'> 
          <'\tgit clone "[myhost:123]:src" ssh-bracket-clone-plink-1 &&\n'> <'\texpect_ssh "-P 123" myhost src\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'tortoiseplink is like putty, with extra arguments'>)} 
      {
        (SQ <'\n'> <'\tcopy_ssh_wrapper_as "$TRASH_DIRECTORY/tortoiseplink" &&\n'> 
          <'\tgit clone "[myhost:123]:src" ssh-bracket-clone-plink-2 &&\n'> <'\texpect_ssh "-batch -P 123" myhost src\n'>
        )
      }
    )
    (C {<setup_ssh_wrapper>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:counter)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [919]
        )
      ]
    )
    (command.ShFunction
      name: test_clone_url
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:counter)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Plus
                            left: {($ Id.VSub_DollarName '$counter')}
                            right: {<Id.Lit_Digits 1>}
                          )
                      )
                    }
                  spids: [939]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {<test_might_fail>} {<git>} {<clone>} {(DQ ($ Id.VSub_Number '$1'))} 
                  {<tmp> ($ Id.VSub_DollarName '$counter')}
                )
                (C {<shift>})
                (C {<expect_ssh>} {(DQ ($ Id.VSub_At '$@'))})
              ]
            )
          ]
        )
    )
    (C {<test_expect_success>} {<Id.KW_Bang '!'> <MINGW>} {(SQ <'clone c:temp is ssl'>)} 
      {(SQ <'\n'> <'\ttest_clone_url c:temp c temp\n'>)}
    )
    (C {<test_expect_success>} {<MINGW>} {(SQ <'clone c:temp is dos drive'>)} 
      {(SQ <'\n'> <'\ttest_clone_url c:temp none\n'>)}
    )
    (command.ForEach
      iter_names: [repo]
      iterable: (for_iter.Words words:[{<rep>} {<'rep/home/project'>} {<123>}])
      body: 
        (command.DoGroup
          children: [
            (C {<test_expect_success>} {(DQ <'clone host:'> ($ Id.VSub_DollarName '$repo'))} 
              {(SQ <'\n'> <'\t\ttest_clone_url host:$repo host $repo\n'> <'\t'>)}
            )
          ]
        )
    )
    (command.ForEach
      iter_names: [repo]
      iterable: (for_iter.Words words:[{<rep>} {<'rep/home/project'>} {<123>}])
      body: 
        (command.DoGroup
          children: [
            (C {<test_expect_success>} {(DQ <'clone [::1]:'> ($ Id.VSub_DollarName '$repo'))} 
              {(SQ <'\n'> <'\t\ttest_clone_url [::1]:$repo ::1 "$repo"\n'> <'\t'>)}
            )
          ]
        )
    )
    (C {<test_expect_success>} {(DQ <'clone host:/~repo'>)} 
      {(SQ <'\n'> <'\ttest_clone_url host:/~repo host "~repo"\n'>)}
    )
    (C {<test_expect_success>} {(DQ <'clone [::1]:/~repo'>)} 
      {(SQ <'\n'> <'\ttest_clone_url [::1]:/~repo ::1 "~repo"\n'>)}
    )
    (command.ForEach
      iter_names: [url]
      iterable: 
        (for_iter.Words
          words: [
            {<'foo/bar'> <Id.Lit_Colon ':'> <baz>}
            {<Id.Lit_LBracket '['> <foo> <Id.Lit_RBracket ']'> <'bar/baz'> <Id.Lit_Colon ':'> <qux>}
            {<Id.Lit_LBracket '['> <'foo/bar'> <Id.Lit_RBracket ']'> <Id.Lit_Colon ':'> <baz>}
          ]
        )
      body: 
        (command.DoGroup
          children: [
            (C {<test_expect_success>} {(DQ <'clone '> ($ Id.VSub_DollarName '$url') <' is not ssh'>)} 
              {(SQ <'\n'> <'\t\ttest_clone_url $url none\n'> <'\t'>)}
            )
          ]
        )
    )
    (command.ForEach
      iter_names: [tcol]
      iterable: (for_iter.Words words:[{(DQ )} {<Id.Lit_Colon ':'>}])
      body: 
        (command.DoGroup
          children: [
            (C {<test_expect_success>} 
              {(DQ <'clone ssh://host.xz'> ($ Id.VSub_DollarName '$tcol') <'/home/user/repo'>)} 
              {
                (SQ <'\n'> 
                  <
'\t\ttest_clone_url "ssh://host.xz$tcol/home/user/repo" host.xz /home/user/repo\n'
                  > <'\t'>
                )
              }
            )
            (C {<test_expect_success>} 
              {(DQ <'clone ssh://host.xz'> ($ Id.VSub_DollarName '$tcol') <'/~repo'>)} {(SQ <'\n'> <'\ttest_clone_url "ssh://host.xz$tcol/~repo" host.xz "~repo"\n'>)}
            )
          ]
        )
    )
    (C {<test_expect_success>} {(SQ <'clone ssh://host.xz:22/home/user/repo'>)} 
      {
        (SQ <'\n'> 
          <'\ttest_clone_url "ssh://host.xz:22/home/user/repo" "-p 22 host.xz" "/home/user/repo"\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'clone ssh://host.xz:22/~repo'>)} 
      {(SQ <'\n'> <'\ttest_clone_url "ssh://host.xz:22/~repo" "-p 22 host.xz" "~repo"\n'>)}
    )
    (command.ForEach
      iter_names: [tuah]
      iterable: 
        (for_iter.Words
          words: [
            {<Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1>}
            {<Id.Lit_LBracket '['> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1> <Id.Lit_RBracket ']'>}
            {<Id.Lit_LBracket '['> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1> <Id.Lit_RBracket ']'> 
              <Id.Lit_Colon ':'>
            }
            {<user> <Id.Lit_At '@'> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1>}
            {<user> <Id.Lit_At '@'> <Id.Lit_LBracket '['> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1> 
              <Id.Lit_RBracket ']'>
            }
            {<user> <Id.Lit_At '@'> <Id.Lit_LBracket '['> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1> 
              <Id.Lit_RBracket ']'> <Id.Lit_Colon ':'>
            }
            {<Id.Lit_LBracket '['> <user> <Id.Lit_At '@'> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1> 
              <Id.Lit_RBracket ']'>
            }
            {<Id.Lit_LBracket '['> <user> <Id.Lit_At '@'> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1> 
              <Id.Lit_RBracket ']'> <Id.Lit_Colon ':'>
            }
          ]
        )
      body: 
        (command.DoGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:ehost)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<echo>} {($ Id.VSub_DollarName '$tuah')})
                              (C {<sed>} {<-e>} {(DQ <'s/1]:/1]/'>)})
                              (C {<tr>} {<-d>} {(DQ <'[]'>)})
                            ]
                            negated: F
                          )
                      )
                    }
                  spids: [1303]
                )
              ]
            )
            (C {<test_expect_success>} 
              {(DQ <'clone ssh://'> ($ Id.VSub_DollarName '$tuah') <'/home/user/repo'>)} 
              {
                (DQ <'\n'> <'\t  test_clone_url ssh://'> ($ Id.VSub_DollarName '$tuah') 
                  <'/home/user/repo '> ($ Id.VSub_DollarName '$ehost') <' /home/user/repo\n'> <'\t'>
                )
              }
            )
          ]
        )
    )
    (command.ForEach
      iter_names: [tuah]
      iterable: 
        (for_iter.Words
          words: [
            {<Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1>}
            {<Id.Lit_LBracket '['> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1> <Id.Lit_RBracket ']'>}
            {<user> <Id.Lit_At '@'> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1>}
            {<user> <Id.Lit_At '@'> <Id.Lit_LBracket '['> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1> 
              <Id.Lit_RBracket ']'>
            }
            {<Id.Lit_LBracket '['> <user> <Id.Lit_At '@'> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1> 
              <Id.Lit_RBracket ']'>
            }
          ]
        )
      body: 
        (command.DoGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:euah)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<echo>} {($ Id.VSub_DollarName '$tuah')})
                              (C {<tr>} {<-d>} {(DQ <'[]'>)})
                            ]
                            negated: F
                          )
                      )
                    }
                  spids: [1396]
                )
              ]
            )
            (C {<test_expect_success>} {(DQ <'clone ssh://'> ($ Id.VSub_DollarName '$tuah') <'/~repo'>)} 
              {
                (DQ <'\n'> <'\t  test_clone_url ssh://'> ($ Id.VSub_DollarName '$tuah') <'/~repo '> 
                  ($ Id.VSub_DollarName '$euah') <' \'~repo\'\n'> <'\t'>
                )
              }
            )
          ]
        )
    )
    (command.ForEach
      iter_names: [tuah]
      iterable: 
        (for_iter.Words
          words: [
            {<Id.Lit_LBracket '['> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1> <Id.Lit_RBracket ']'>}
            {<user> <Id.Lit_At '@'> <Id.Lit_LBracket '['> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1> 
              <Id.Lit_RBracket ']'>
            }
            {<Id.Lit_LBracket '['> <user> <Id.Lit_At '@'> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1> 
              <Id.Lit_RBracket ']'>
            }
          ]
        )
      body: 
        (command.DoGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:euah)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<echo>} {($ Id.VSub_DollarName '$tuah')})
                              (C {<tr>} {<-d>} {(DQ <'[]'>)})
                            ]
                            negated: F
                          )
                      )
                    }
                  spids: [1469]
                )
              ]
            )
            (C {<test_expect_success>} 
              {(DQ <'clone ssh://'> ($ Id.VSub_DollarName '$tuah') <':22/home/user/repo'>)} 
              {
                (DQ <'\n'> <'\t  test_clone_url ssh://'> ($ Id.VSub_DollarName '$tuah') 
                  <':22/home/user/repo \'-p 22\' '> ($ Id.VSub_DollarName '$euah') <' /home/user/repo\n'> <'\t'>
                )
              }
            )
          ]
        )
    )
    (command.ForEach
      iter_names: [tuah]
      iterable: 
        (for_iter.Words
          words: [
            {<Id.Lit_LBracket '['> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1> <Id.Lit_RBracket ']'>}
            {<user> <Id.Lit_At '@'> <Id.Lit_LBracket '['> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1> 
              <Id.Lit_RBracket ']'>
            }
            {<Id.Lit_LBracket '['> <user> <Id.Lit_At '@'> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <1> 
              <Id.Lit_RBracket ']'>
            }
          ]
        )
      body: 
        (command.DoGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:euah)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<echo>} {($ Id.VSub_DollarName '$tuah')})
                              (C {<tr>} {<-d>} {(DQ <'[]'>)})
                            ]
                            negated: F
                          )
                      )
                    }
                  spids: [1542]
                )
              ]
            )
            (C {<test_expect_success>} 
              {(DQ <'clone ssh://'> ($ Id.VSub_DollarName '$tuah') <':22/~repo'>)} 
              {
                (DQ <'\n'> <'\t  test_clone_url ssh://'> ($ Id.VSub_DollarName '$tuah') 
                  <':22/~repo \'-p 22\' '> ($ Id.VSub_DollarName '$euah') <' \'~repo\'\n'> <'\t'>
                )
              }
            )
          ]
        )
    )
    (C {<test_expect_success>} {(SQ <'clone from a repository with two identical branches'>)} 
      {
        (SQ <'\n'> <'\n'> <'\t(\n'> <'\t\tcd src &&\n'> <'\t\tgit checkout -b another master\n'> 
          <'\t) &&\n'> <'\tgit clone src target-11 &&\n'> 
          <'\ttest "z$( cd target-11 && git symbolic-ref HEAD )" = zrefs/heads/another\n'> <'\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'shallow clone locally'>)} 
      {
        (SQ <'\n'> <'\tgit clone --depth=1 --no-local src ssrrcc &&\n'> 
          <'\tgit clone ssrrcc ddsstt &&\n'> <'\ttest_cmp ssrrcc/.git/shallow ddsstt/.git/shallow &&\n'> <'\t( cd ddsstt && git fsck )\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'GIT_TRACE_PACKFILE produces a usable pack'>)} 
      {
        (SQ <'\n'> <'\trm -rf dst.git &&\n'> 
          <'\tGIT_TRACE_PACKFILE=$PWD/tmp.pack git clone --no-local --bare src dst.git &&\n'> <'\tgit init --bare replay.git &&\n'> <'\tgit -C replay.git index-pack -v --stdin <tmp.pack\n'>
        )
      }
    )
    (C {<test_done>})
  ]
)