(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 <'basic symbolic-ref tests'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./test-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.ShFunction
      name_tok: <reset_to_sane>
      name: reset_to_sane
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <echo>
              more_env: []
              words: [{<echo>} {<ref> <Id.Lit_Colon ':'>} {<'refs/heads/foo'>}]
              redirects: [(Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'.git/HEAD'>})]
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'symbolic-ref writes HEAD'>)}
        {
          (SQ <'\n'> <'\tgit symbolic-ref HEAD refs/heads/foo &&\n'> 
            <'\techo ref: refs/heads/foo >expect &&\n'> <'\ttest_cmp expect .git/HEAD\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'symbolic-ref reads HEAD'>)}
        {
          (SQ <'\n'> <'\techo refs/heads/foo >expect &&\n'> <'\tgit symbolic-ref HEAD >actual &&\n'> 
            <'\ttest_cmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'symbolic-ref refuses non-ref for HEAD'>)}
        {(SQ <'\n'> <'\ttest_must_fail git symbolic-ref HEAD foo\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <reset_to_sane>
      more_env: []
      words: [{<reset_to_sane>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'symbolic-ref refuses bare sha1'>)}
        {
          (SQ <'\n'> <'\techo content >file && git add file && git commit -m one &&\n'> 
            <'\ttest_must_fail git symbolic-ref HEAD $(git rev-parse HEAD)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <reset_to_sane>
      more_env: []
      words: [{<reset_to_sane>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'HEAD cannot be removed'>)}
        {(SQ <'\n'> <'\ttest_must_fail git symbolic-ref -d HEAD\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <reset_to_sane>
      more_env: []
      words: [{<reset_to_sane>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'symbolic-ref can be deleted'>)}
        {
          (SQ <'\n'> <'\tgit symbolic-ref NOTHEAD refs/heads/foo &&\n'> 
            <'\tgit symbolic-ref -d NOTHEAD &&\n'> <'\ttest_path_is_file .git/refs/heads/foo &&\n'> <'\ttest_path_is_missing .git/NOTHEAD\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <reset_to_sane>
      more_env: []
      words: [{<reset_to_sane>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'symbolic-ref can delete dangling symref'>)}
        {
          (SQ <'\n'> <'\tgit symbolic-ref NOTHEAD refs/heads/missing &&\n'> 
            <'\tgit symbolic-ref -d NOTHEAD &&\n'> <'\ttest_path_is_missing .git/refs/heads/missing &&\n'> <'\ttest_path_is_missing .git/NOTHEAD\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <reset_to_sane>
      more_env: []
      words: [{<reset_to_sane>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'symbolic-ref fails to delete missing FOO'>)}
        {
          (SQ <'\n'> <'\techo "fatal: Cannot delete FOO, not a symbolic ref" >expect &&\n'> 
            <'\ttest_must_fail git symbolic-ref -d FOO >actual 2>&1 &&\n'> <'\ttest_cmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <reset_to_sane>
      more_env: []
      words: [{<reset_to_sane>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'symbolic-ref fails to delete real ref'>)}
        {
          (SQ <'\n'> <'\techo "fatal: Cannot delete refs/heads/foo, not a symbolic ref" >expect &&\n'> 
            <'\ttest_must_fail git symbolic-ref -d refs/heads/foo >actual 2>&1 &&\n'> <'\ttest_path_is_file .git/refs/heads/foo &&\n'> <'\ttest_cmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <reset_to_sane>
      more_env: []
      words: [{<reset_to_sane>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'create large ref name'>)}
        {
          (SQ <'\n'> <'\t# make 256+ character ref; some systems may not handle that,\n'> 
            <'\t# so be gentle\n'> <'\tlong=0123456789abcdef &&\n'> <'\tlong=$long/$long/$long/$long &&\n'> 
            <'\tlong=$long/$long/$long/$long &&\n'> <'\tlong_ref=refs/heads/$long &&\n'> <'\ttree=$(git write-tree) &&\n'> 
            <'\tcommit=$(echo foo | git commit-tree $tree) &&\n'> <'\tif git update-ref $long_ref $commit; then\n'> <'\t\ttest_set_prereq LONG_REF\n'> <'\telse\n'> 
            <'\t\techo >&2 "long refs not supported"\n'> <'\tfi\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<LONG_REF>}
        {(SQ <'symbolic-ref can point to large ref name'>)}
        {
          (SQ <'\n'> <'\tgit symbolic-ref HEAD $long_ref &&\n'> <'\techo $long_ref >expect &&\n'> 
            <'\tgit symbolic-ref HEAD >actual &&\n'> <'\ttest_cmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<LONG_REF>}
        {(SQ <'we can parse long symbolic ref'>)}
        {
          (SQ <'\n'> <'\techo $commit >expect &&\n'> <'\tgit rev-parse --verify HEAD >actual &&\n'> 
            <'\ttest_cmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'symbolic-ref reports failure in exit code'>)}
        {
          (SQ <'\n'> <'\ttest_when_finished "rm -f .git/HEAD.lock" &&\n'> <'\t>.git/HEAD.lock &&\n'> 
            <'\ttest_must_fail git symbolic-ref HEAD refs/heads/whatever\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'symbolic-ref writes reflog entry'>)}
        {
          (SQ <'\n'> <'\tgit checkout -b log1 &&\n'> <'\ttest_commit one &&\n'> 
            <'\tgit checkout -b log2  &&\n'> <'\ttest_commit two &&\n'> <'\tgit checkout --orphan orphan &&\n'> 
            <'\tgit symbolic-ref -m create HEAD refs/heads/log1 &&\n'> <'\tgit symbolic-ref -m update HEAD refs/heads/log2 &&\n'> <'\tcat >expect <<-\\EOF &&\n'> 
            <'\tupdate\n'> <'\tcreate\n'> <'\tEOF\n'> <'\tgit log --format=%gs -g -2 >actual &&\n'> <'\ttest_cmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'symbolic-ref does not create ref d/f conflicts'>)}
        {
          (SQ <'\n'> <'\tgit checkout -b df &&\n'> <'\ttest_commit df &&\n'> 
            <'\ttest_must_fail git symbolic-ref refs/heads/df/conflict refs/heads/df &&\n'> <'\tgit pack-refs --all --prune &&\n'> 
            <'\ttest_must_fail git symbolic-ref refs/heads/df/conflict refs/heads/df\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'symbolic-ref handles existing pointer to invalid name'>)}
        {
          (SQ <'\n'> <'\thead=$(git rev-parse HEAD) &&\n'> 
            <'\tgit symbolic-ref HEAD refs/heads/outer &&\n'> <'\tgit update-ref refs/heads/outer/inner $head &&\n'> 
            <'\tgit symbolic-ref HEAD refs/heads/unrelated\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)