(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'check output directory names used by git-clone'>)}
          spids: [4]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (C {<test_expect_success>} {(SQ <'setup ssh wrapper'>)} 
      {
        (SQ <'\n'> <'\twrite_script "$TRASH_DIRECTORY/ssh-wrapper" <<-\\EOF &&\n'> 
          <'\tgit upload-pack "$TRASH_DIRECTORY"\n'> <'\tEOF\n'> <'\tGIT_SSH="$TRASH_DIRECTORY/ssh-wrapper" &&\n'> <'\texport GIT_SSH &&\n'> 
          <'\texport TRASH_DIRECTORY\n'>
        )
      }
    )
    (command.ShFunction
      name: test_clone_dir
      body: 
        (BraceGroup
          children: [
            (command.Sentence
              child: 
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:url)
                      op: assign_op.Equal
                      rhs: {($ Id.VSub_Number '$1')}
                      spids: [51]
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
            (C {<shift>})
            (command.Sentence
              child: 
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:dir)
                      op: assign_op.Equal
                      rhs: {($ Id.VSub_Number '$1')}
                      spids: [58]
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
            (C {<shift>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:expect)
                  op: assign_op.Equal
                  rhs: {<success>}
                  spids: [65]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:bare)
                  op: assign_op.Equal
                  rhs: {<non-bare>}
                  spids: [69]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:clone_opts)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [73]
                )
              ]
            )
            (command.ForEach
              iter_name: i
              iter_words: [{(DQ ($ Id.VSub_At '$@'))}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_DollarName '$i'))}
                      arms: [
                        (case_arm
                          pat_list: [{<fail>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:expect)
                                  op: assign_op.Equal
                                  rhs: {<failure>}
                                  spids: [103]
                                )
                              ]
                            )
                          ]
                          spids: [99 100 107 -1]
                        )
                        (case_arm
                          pat_list: [{<bare>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:bare)
                                  op: assign_op.Equal
                                  rhs: {<bare>}
                                  spids: [114]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:clone_opts)
                                  op: assign_op.Equal
                                  rhs: {<--bare>}
                                  spids: [118]
                                )
                              ]
                            )
                          ]
                          spids: [110 111 122 -1]
                        )
                      ]
                    )
                  ]
                )
            )
            (C {<test_expect_> ($ Id.VSub_DollarName '$expect')} 
              {
                (DQ <'clone of '> ($ Id.VSub_DollarName '$url') <' goes to '> 
                  ($ Id.VSub_DollarName '$dir') <' ('> ($ Id.VSub_DollarName '$bare') <')'>
                )
              } 
              {
                (DQ <'\n'> <'\t\trm -rf '> ($ Id.VSub_DollarName '$dir') <' &&\n'> <'\t\tgit clone '> 
                  ($ Id.VSub_DollarName '$clone_opts') <' '> ($ Id.VSub_DollarName '$url') <' &&\n'> <'\t\ttest_path_is_dir '> ($ Id.VSub_DollarName '$dir') 
                  <'\n'> <'\t'>
                )
              }
            )
          ]
        )
    )
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <foo>} {<foo>})
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <foo>} {<foo.git>} {<bare>})
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <foo.git>} {<foo>})
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <foo.git>} {<foo.git>} {<bare>})
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <'foo/.git'>} {<foo>})
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <'foo/.git'>} {<foo.git>} {<bare>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/foo'>} {<foo>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/foo'>} {<foo.git>} {<bare>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/foo.git'>} {<foo>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/foo.git'>} {<foo.git>} {<bare>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/foo/.git'>} {<foo>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/foo/.git'>} {<foo.git>} {<bare>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/foo/'>} {<foo>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/foo///'>} {<foo>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/foo/.git/'>} {<foo>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/foo.git/'>} {<foo>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/foo.git///'>} {<foo>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/foo///.git/'>} {<foo>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/foo/.git///'>} {<foo>})
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <'foo/'>} {<foo>})
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <'foo///'>} {<foo>})
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <'foo.git/'>} {<foo>})
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <'foo/.git/'>} {<foo>})
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <'foo.git///'>} {<foo>})
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <'foo///.git/'>} {<foo>})
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <'foo/.git///'>} {<foo>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/'>} {<host>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host'> <Id.Lit_Colon ':'> <'1234/'>} {<host>})
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//user'> <Id.Lit_Splice '@host'> <'/'>} {<host>})
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <'/'>} {<host>})
    (C {<test_clone_dir>} 
      {<ssh> <Id.Lit_Colon ':'> <'//user'> <Id.Lit_Colon ':'> <password> <Id.Lit_Splice '@host'> <'/'>} {<host>}
    )
    (C {<test_clone_dir>} 
      {<ssh> <Id.Lit_Colon ':'> <'//user'> <Id.Lit_Colon ':'> <password> <Id.Lit_Splice '@host'> 
        <Id.Lit_Colon ':'> <'1234/'>
      } {<host>}
    )
    (C {<test_clone_dir>} 
      {<ssh> <Id.Lit_Colon ':'> <'//user'> <Id.Lit_Colon ':'> <passw> <Id.Lit_Splice '@rd'> 
        <Id.Lit_Splice '@host'> <Id.Lit_Colon ':'> <'1234/'>
      } {<host>}
    )
    (C {<test_clone_dir>} {<user> <Id.Lit_Splice '@host'> <Id.Lit_Colon ':'> <'/'>} {<host>})
    (C {<test_clone_dir>} 
      {<user> <Id.Lit_Colon ':'> <password> <Id.Lit_Splice '@host'> <Id.Lit_Colon ':'> <'/'>} {<host>}
    )
    (C {<test_clone_dir>} 
      {<user> <Id.Lit_Colon ':'> <passw> <Id.Lit_Splice '@rd'> <Id.Lit_Splice '@host'> <Id.Lit_Colon ':'> 
        <'/'>
      } {<host>}
    )
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/foo'> <Id.Lit_Splice '@bar'>} 
      {<foo> <Id.Lit_Splice '@bar'>}
    )
    (C {<test_clone_dir>} {<ssh> <Id.Lit_Colon ':'> <'//host/foo'> <Id.Lit_Splice '@bar'> <.git>} 
      {<foo> <Id.Lit_Splice '@bar'>}
    )
    (C {<test_clone_dir>} 
      {<ssh> <Id.Lit_Colon ':'> <'//user'> <Id.Lit_Colon ':'> <password> <Id.Lit_Splice '@host'> <'/foo'> 
        <Id.Lit_Splice '@bar'>
      } {<foo> <Id.Lit_Splice '@bar'>}
    )
    (C {<test_clone_dir>} 
      {<ssh> <Id.Lit_Colon ':'> <'//user'> <Id.Lit_Colon ':'> <passw> <Id.Lit_Splice '@rd'> 
        <Id.Lit_Splice '@host'> <'/foo'> <Id.Lit_Splice '@bar'> <.git>
      } {<foo> <Id.Lit_Splice '@bar'>}
    )
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <'/foo'> <Id.Lit_Splice '@bar'>} 
      {<foo> <Id.Lit_Splice '@bar'>}
    )
    (C {<test_clone_dir>} {<host> <Id.Lit_Colon ':'> <'/foo'> <Id.Lit_Splice '@bar'> <.git>} 
      {<foo> <Id.Lit_Splice '@bar'>}
    )
    (C {<test_clone_dir>} 
      {<user> <Id.Lit_Colon ':'> <password> <Id.Lit_Splice '@host'> <Id.Lit_Colon ':'> <'/foo'> 
        <Id.Lit_Splice '@bar'>
      } {<foo> <Id.Lit_Splice '@bar'>}
    )
    (C {<test_clone_dir>} 
      {<user> <Id.Lit_Colon ':'> <passw> <Id.Lit_Splice '@rd'> <Id.Lit_Splice '@host'> <Id.Lit_Colon ':'> 
        <'/foo'> <Id.Lit_Splice '@bar'> <.git>
      } {<foo> <Id.Lit_Splice '@bar'>}
    )
    (C {<test_clone_dir>} 
      {<ssh> <Id.Lit_Colon ':'> <'//user'> <Id.Lit_Colon ':'> <password> <Id.Lit_Splice '@host'> <'/test'> 
        <Id.Lit_Colon ':'> <1234>
      } {<1234>}
    )
    (C {<test_clone_dir>} 
      {<ssh> <Id.Lit_Colon ':'> <'//user'> <Id.Lit_Colon ':'> <password> <Id.Lit_Splice '@host'> <'/test'> 
        <Id.Lit_Colon ':'> <1234.git>
      } {<1234>}
    )
    (C {<test_done>})
  ]
)