(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 git update-ref and basic ref logging'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./test-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'Z='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'Z='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'Z='> name:Z)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName _z40)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<setup>}
        {
          (SQ <'\n'> <'\n'> <'\tfor name in A B C D E F\n'> <'\tdo\n'> <'\t\ttest_tick &&\n'> 
            <'\t\tT=$(git write-tree) &&\n'> <'\t\tsha1=$(echo $name | git commit-tree $T) &&\n'> <'\t\teval $name=$sha1\n'> <'\tdone\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'm='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'm='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'm='> name:m)
          op: assign_op.Equal
          rhs: {<'refs/heads/master'>}
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'n_dir='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'n_dir='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'n_dir='> name:n_dir)
          op: assign_op.Equal
          rhs: {<'refs/heads/gu'>}
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'n='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'n='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'n='> name:n)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName n_dir) <'/fixes'>}
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'outside='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'outside='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'outside='> name:outside)
          op: assign_op.Equal
          rhs: {<'refs/foo'>}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'create '> ($ Id.VSub_DollarName m))}
        {
          (DQ <'git update-ref '> ($ Id.VSub_DollarName m) <' '> ($ Id.VSub_DollarName A) <' &&\n'> 
            <'\t test '> ($ Id.VSub_DollarName A)
          ) (SQ <' = $(cat .git/'>) (DQ ($ Id.VSub_DollarName m)) (SQ <')'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'create '> ($ Id.VSub_DollarName m))}
        {
          (DQ <'git update-ref '> ($ Id.VSub_DollarName m) <' '> ($ Id.VSub_DollarName B) <' '> 
            ($ Id.VSub_DollarName A) <' &&\n'> <'\t test '> ($ Id.VSub_DollarName B)
          ) (SQ <' = $(cat .git/'>) (DQ ($ Id.VSub_DollarName m)) (SQ <')'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'fail to delete '> ($ Id.VSub_DollarName m) <' with stale ref'>)}
        {
          (SQ <'\n'> <'\ttest_must_fail git update-ref -d $m $A &&\n'> 
            <'\ttest $B = "$(cat .git/$m)"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'delete '> ($ Id.VSub_DollarName m))}
        {(SQ <'\n'> <'\tgit update-ref -d $m $B &&\n'> <'\t! test -f .git/$m\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <rm>
      more_env: []
      words: [{<rm>} {<-f>} {<'.git/'> ($ Id.VSub_DollarName m)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'delete '> ($ Id.VSub_DollarName m) <' without oldvalue verification'>)}
        {
          (DQ <'\n'> <'\tgit update-ref '> ($ Id.VSub_DollarName m) <' '> ($ Id.VSub_DollarName A) 
            <' &&\n'> <'\ttest '> ($ Id.VSub_DollarName A) <' = '> 
            (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'> ch:'$') <'(cat .git/'> ($ Id.VSub_DollarName m) <') &&\n'> <'\tgit update-ref -d '> ($ Id.VSub_DollarName m) 
            <' &&\n'> <'\t! test -f .git/'> ($ Id.VSub_DollarName m) <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <rm>
      more_env: []
      words: [{<rm>} {<-f>} {<'.git/'> ($ Id.VSub_DollarName m)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'fail to create '> ($ Id.VSub_DollarName n))}
        {
          (DQ <'touch .git/'> ($ Id.VSub_DollarName n_dir) <' &&\n'> 
            <'\t test_must_fail git update-ref '> ($ Id.VSub_DollarName n) <' '> ($ Id.VSub_DollarName A) <' >out 2>err'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <rm>
      more_env: []
      words: [{<rm>} {<-f>} {<'.git/'> ($ Id.VSub_DollarName n_dir)} {<out>} {<err>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'create '> ($ Id.VSub_DollarName m) <' (by HEAD)'>)}
        {
          (DQ <'git update-ref HEAD '> ($ Id.VSub_DollarName A) <' &&\n'> <'\t test '> 
            ($ Id.VSub_DollarName A)
          ) (SQ <' = $(cat .git/'>) (DQ ($ Id.VSub_DollarName m)) (SQ <')'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'create '> ($ Id.VSub_DollarName m) <' (by HEAD)'>)}
        {
          (DQ <'git update-ref HEAD '> ($ Id.VSub_DollarName B) <' '> ($ Id.VSub_DollarName A) <' &&\n'> 
            <'\t test '> ($ Id.VSub_DollarName B)
          ) (SQ <' = $(cat .git/'>) (DQ ($ Id.VSub_DollarName m)) (SQ <')'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'fail to delete '> ($ Id.VSub_DollarName m) <' (by HEAD) with stale ref'>)}
        {
          (SQ <'\n'> <'\ttest_must_fail git update-ref -d HEAD $A &&\n'> 
            <'\ttest $B = $(cat .git/$m)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'delete '> ($ Id.VSub_DollarName m) <' (by HEAD)'>)}
        {(SQ <'\n'> <'\tgit update-ref -d HEAD $B &&\n'> <'\t! test -f .git/$m\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <rm>
      more_env: []
      words: [{<rm>} {<-f>} {<'.git/'> ($ Id.VSub_DollarName m)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'update-ref does not create reflogs by default'>)}
        {
          (SQ <'\n'> <'\ttest_when_finished "git update-ref -d $outside" &&\n'> 
            <'\tgit update-ref $outside $A &&\n'> <'\tgit rev-parse $A >expect &&\n'> <'\tgit rev-parse $outside >actual &&\n'> 
            <'\ttest_cmp expect actual &&\n'> <'\ttest_must_fail git reflog exists $outside\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'update-ref creates reflogs with --create-reflog'>)}
        {
          (SQ <'\n'> <'\ttest_when_finished "git update-ref -d $outside" &&\n'> 
            <'\tgit update-ref --create-reflog $outside $A &&\n'> <'\tgit rev-parse $A >expect &&\n'> <'\tgit rev-parse $outside >actual &&\n'> 
            <'\ttest_cmp expect actual &&\n'> <'\tgit reflog exists $outside\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'create '> ($ Id.VSub_DollarName m) <' (by HEAD)'>)}
        {
          (DQ <'git update-ref HEAD '> ($ Id.VSub_DollarName A) <' &&\n'> <'\t test '> 
            ($ Id.VSub_DollarName A)
          ) (SQ <' = $(cat .git/'>) (DQ ($ Id.VSub_DollarName m)) (SQ <')'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [{<test_expect_success>} {(DQ <'pack refs'>)} {(DQ <'git pack-refs --all'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'move '> ($ Id.VSub_DollarName m) <' (by HEAD)'>)}
        {
          (DQ <'git update-ref HEAD '> ($ Id.VSub_DollarName B) <' '> ($ Id.VSub_DollarName A) <' &&\n'> 
            <'\t test '> ($ Id.VSub_DollarName B)
          ) (SQ <' = $(cat .git/'>) (DQ ($ Id.VSub_DollarName m)) (SQ <')'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {
          (DQ <'delete '> ($ Id.VSub_DollarName m) <' (by HEAD) should remove both packed and loose '> 
            ($ Id.VSub_DollarName m)
          )
        }
        {
          (SQ <'\n'> <'\tgit update-ref -d HEAD $B &&\n'> <'\t! grep "$m" .git/packed-refs &&\n'> 
            <'\t! test -f .git/$m\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <rm>
      more_env: []
      words: [{<rm>} {<-f>} {<'.git/'> ($ Id.VSub_DollarName m)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cp>
      more_env: []
      words: [{<cp>} {<-f>} {<'.git/HEAD'>} {<'.git/HEAD.orig'>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'delete symref without dereference'>)}
        {(SQ <'\n'> <'\tgit update-ref --no-deref -d HEAD &&\n'> <'\t! test -f .git/HEAD\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cp>
      more_env: []
      words: [{<cp>} {<-f>} {<'.git/HEAD.orig'>} {<'.git/HEAD'>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'delete symref without dereference when the referred ref is packed'>)}
        {
          (SQ <'\n'> <'\techo foo >foo.c &&\n'> <'\tgit add foo.c &&\n'> <'\tgit commit -m foo &&\n'> 
            <'\tgit pack-refs --all &&\n'> <'\tgit update-ref --no-deref -d HEAD &&\n'> <'\t! test -f .git/HEAD\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cp>
      more_env: []
      words: [{<cp>} {<-f>} {<'.git/HEAD.orig'>} {<'.git/HEAD'>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <git>
      more_env: []
      words: [{<git>} {<update-ref>} {<-d>} {($ Id.VSub_DollarName m)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'update-ref -d is not confused by self-reference'>)}
        {
          (SQ <'\n'> <'\tgit symbolic-ref refs/heads/self refs/heads/self &&\n'> 
            <'\ttest_when_finished "rm -f .git/refs/heads/self" &&\n'> <'\ttest_path_is_file .git/refs/heads/self &&\n'> 
            <'\ttest_must_fail git update-ref -d refs/heads/self &&\n'> <'\ttest_path_is_file .git/refs/heads/self\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'update-ref --no-deref -d can delete self-reference'>)}
        {
          (SQ <'\n'> <'\tgit symbolic-ref refs/heads/self refs/heads/self &&\n'> 
            <'\ttest_when_finished "rm -f .git/refs/heads/self" &&\n'> <'\ttest_path_is_file .git/refs/heads/self &&\n'> 
            <'\tgit update-ref --no-deref -d refs/heads/self &&\n'> <'\ttest_path_is_missing .git/refs/heads/self\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'update-ref --no-deref -d can delete reference to bad ref'>)}
        {
          (SQ <'\n'> <'\t>.git/refs/heads/bad &&\n'> 
            <'\ttest_when_finished "rm -f .git/refs/heads/bad" &&\n'> <'\tgit symbolic-ref refs/heads/ref-to-bad refs/heads/bad &&\n'> 
            <'\ttest_when_finished "rm -f .git/refs/heads/ref-to-bad" &&\n'> <'\ttest_path_is_file .git/refs/heads/ref-to-bad &&\n'> 
            <'\tgit update-ref --no-deref -d refs/heads/ref-to-bad &&\n'> <'\ttest_path_is_missing .git/refs/heads/ref-to-bad\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'(not) create HEAD with old sha1'>)}
        {
          (DQ <'\n'> <'\ttest_must_fail git update-ref HEAD '> ($ Id.VSub_DollarName A) <' '> 
            ($ Id.VSub_DollarName B) <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'(not) prior created .git/'> ($ Id.VSub_DollarName m))}
        {(DQ <'\n'> <'\t! test -f .git/'> ($ Id.VSub_DollarName m) <'\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <rm>
      more_env: []
      words: [{<rm>} {<-f>} {<'.git/'> ($ Id.VSub_DollarName m)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'create HEAD'>)}
        {(DQ <'git update-ref HEAD '> ($ Id.VSub_DollarName A))}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'(not) change HEAD with wrong SHA1'>)}
        {
          (DQ <'\n'> <'\ttest_must_fail git update-ref HEAD '> ($ Id.VSub_DollarName B) <' '> 
            ($ Id.VSub_DollarName Z) <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'(not) changed .git/'> ($ Id.VSub_DollarName m))}
        {(DQ <'\n'> <'\t! test '> ($ Id.VSub_DollarName B)) (SQ <' = $(cat .git/'>) 
          (DQ ($ Id.VSub_DollarName m)) (SQ <')\n'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <rm>
      more_env: []
      words: [{<rm>} {<-f>} {<'.git/'> ($ Id.VSub_DollarName m)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <rm>
      more_env: []
      words: [{<rm>} {<-f>} {<'.git/logs/refs/heads/master'>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'create '> ($ Id.VSub_DollarName m) <' (logged by touch)'>)}
        {
          (SQ <'GIT_COMMITTER_DATE="2005-05-26 23:30" \\\n'> 
            <'\t git update-ref --create-reflog HEAD '>
          ) (DQ ($ Id.VSub_DollarName A)) (SQ <' -m "Initial Creation" &&\n'> <'\t test '>) 
          (DQ ($ Id.VSub_DollarName A)) (SQ <' = $(cat .git/'>) (DQ ($ Id.VSub_DollarName m)) (SQ <')'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'update '> ($ Id.VSub_DollarName m) <' (logged by touch)'>)}
        {(SQ <'GIT_COMMITTER_DATE="2005-05-26 23:31" \\\n'> <'\t git update-ref HEAD'>) 
          (DQ <' '> ($ Id.VSub_DollarName B) <' '> ($ Id.VSub_DollarName A) <' '>) (SQ <'-m "Switch" &&\n'> <'\t test '>) (DQ ($ Id.VSub_DollarName B)) (SQ <' = $(cat .git/'>) 
          (DQ ($ Id.VSub_DollarName m)) (SQ <')'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'set '> ($ Id.VSub_DollarName m) <' (logged by touch)'>)}
        {(SQ <'GIT_COMMITTER_DATE="2005-05-26 23:41" \\\n'> <'\t git update-ref HEAD'>) 
          (DQ <' '> ($ Id.VSub_DollarName A) <' &&\n'> <'\t test '> ($ Id.VSub_DollarName A)) (SQ <' = $(cat .git/'>) (DQ ($ Id.VSub_DollarName m)) (SQ <')'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                ($ Id.VSub_DollarName Z)
                <' '>
                ($ Id.VSub_DollarName A)
                <' '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> 1117150200 +0000\tInitial Creation\n'>
                ($ Id.VSub_DollarName A)
                <' '>
                ($ Id.VSub_DollarName B)
                <' '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> 1117150260 +0000\tSwitch\n'>
                ($ Id.VSub_DollarName B)
                <' '>
                ($ Id.VSub_DollarName A)
                <' '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> 1117150860 +0000\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'verifying '> ($ Id.VSub_DollarName m) <'\'s log'>)}
        {(DQ <'test_cmp expect .git/logs/'> ($ Id.VSub_DollarName m))}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <rm>
      more_env: []
      words: [{<rm>} {<-rf>} {<'.git/'> ($ Id.VSub_DollarName m)} {<'.git/logs'>} {<expect>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'enable core.logAllRefUpdates'>)}
        {
          (SQ <'git config core.logAllRefUpdates true &&\n'> 
            <'\t test true = $(git config --bool --get core.logAllRefUpdates)'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'create '> ($ Id.VSub_DollarName m) <' (logged by config)'>)}
        {(SQ <'GIT_COMMITTER_DATE="2005-05-26 23:32" \\\n'> <'\t git update-ref HEAD'>) 
          (DQ <' '> ($ Id.VSub_DollarName A) <' '>) (SQ <'-m "Initial Creation" &&\n'> <'\t test '>) (DQ ($ Id.VSub_DollarName A)) (SQ <' = $(cat .git/'>) 
          (DQ ($ Id.VSub_DollarName m)) (SQ <')'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'update '> ($ Id.VSub_DollarName m) <' (logged by config)'>)}
        {(SQ <'GIT_COMMITTER_DATE="2005-05-26 23:33" \\\n'> <'\t git update-ref HEAD'>) 
          (DQ <' '> ($ Id.VSub_DollarName B) <' '> ($ Id.VSub_DollarName A) <' '>) (SQ <'-m "Switch" &&\n'> <'\t test '>) (DQ ($ Id.VSub_DollarName B)) (SQ <' = $(cat .git/'>) 
          (DQ ($ Id.VSub_DollarName m)) (SQ <')'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'set '> ($ Id.VSub_DollarName m) <' (logged by config)'>)}
        {(SQ <'GIT_COMMITTER_DATE="2005-05-26 23:43" \\\n'> <'\t git update-ref HEAD '>) 
          (DQ ($ Id.VSub_DollarName A) <' &&\n'> <'\t test '> ($ Id.VSub_DollarName A)) (SQ <' = $(cat .git/'>) (DQ ($ Id.VSub_DollarName m)) (SQ <')'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                ($ Id.VSub_DollarName Z)
                <' '>
                ($ Id.VSub_DollarName A)
                <' '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> 1117150320 +0000\tInitial Creation\n'>
                ($ Id.VSub_DollarName A)
                <' '>
                ($ Id.VSub_DollarName B)
                <' '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> 1117150380 +0000\tSwitch\n'>
                ($ Id.VSub_DollarName B)
                <' '>
                ($ Id.VSub_DollarName A)
                <' '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> 1117150980 +0000\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'verifying '> ($ Id.VSub_DollarName m) <'\'s log'>)}
        {(SQ <'test_cmp expect .git/logs/$m'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <rm>
      more_env: []
      words: [
        {<rm>}
        {<-f>}
        {<'.git/'> ($ Id.VSub_DollarName m)}
        {<'.git/logs/'> ($ Id.VSub_DollarName m)}
        {<expect>}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <git>
      more_env: []
      words: [{<git>} {<update-ref>} {($ Id.VSub_DollarName m)} {($ Id.VSub_DollarName D)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir
          op: <Id.Redir_Great '>'>
          loc: (redir_loc.Fd fd:1)
          arg: {<'.git/logs/'> ($ Id.VSub_DollarName m)}
        )
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'0000000000000000000000000000000000000000 '>
                ($ Id.VSub_DollarName C)
                <' '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> 1117150320 -0500\n'>
                ($ Id.VSub_DollarName C)
                <' '>
                ($ Id.VSub_DollarName A)
                <' '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> 1117150350 -0500\n'>
                ($ Id.VSub_DollarName A)
                <' '>
                ($ Id.VSub_DollarName B)
                <' '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> 1117150380 -0500\n'>
                ($ Id.VSub_DollarName F)
                <' '>
                ($ Id.VSub_DollarName Z)
                <' '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> 1117150680 -0500\n'>
                ($ Id.VSub_DollarName Z)
                <' '>
                ($ Id.VSub_DollarName E)
                <' '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> 1117150980 -0500\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'ed='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'ed='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ed='> name:ed)
          op: assign_op.Equal
          rhs: {(DQ <'Thu, 26 May 2005 18:32:00 -0500'>)}
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'gd='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'gd='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'gd='> name:gd)
          op: assign_op.Equal
          rhs: {(DQ <'Thu, 26 May 2005 18:33:00 -0500'>)}
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'ld='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'ld='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ld='> name:ld)
          op: assign_op.Equal
          rhs: {(DQ <'Thu, 26 May 2005 18:43:00 -0500'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'Query "master@{May 25 2005}" (before history)'>)}
        {
          (SQ <'rm -f o e &&\n'> <'\t git rev-parse --verify "master@{May 25 2005}" >o 2>e &&\n'> 
            <'\t test '>
          ) (DQ ($ Id.VSub_DollarName C)) (SQ <' = $(cat o) &&\n'> <'\t test "warning: Log for '>) 
          (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''> ch:'\'') <master> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''> ch:'\'') 
          (SQ <' only goes back to $ed." = "$(cat e)"'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(DQ <'Query master@{2005-05-25} (before history)'>)}
        {
          (SQ <'rm -f o e &&\n'> <'\t git rev-parse --verify master@{2005-05-25} >o 2>e &&\n'> 
            <'\t test '>
          ) (DQ ($ Id.VSub_DollarName C)) (SQ <' = $(cat o) &&\n'> <'\t echo test "warning: Log for '>) 
          (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''> ch:'\'') <master> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''> ch:'\'') 
          (SQ <' only goes back to $ed." = "$(cat e)"'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'Query "master@{May 26 2005 23:31:59}" (1 second before history)'>)}
        {
          (SQ <'rm -f o e &&\n'> 
            <'\t git rev-parse --verify "master@{May 26 2005 23:31:59}" >o 2>e &&\n'> <'\t test '>
          ) (DQ ($ Id.VSub_DollarName C)) (SQ <' = $(cat o) &&\n'> <'\t test "warning: Log for '>) 
          (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''> ch:'\'') (SQ <master>) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''> ch:'\'') 
          (SQ <' only goes back to $ed." = "$(cat e)"'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'Query "master@{May 26 2005 23:32:00}" (exactly history start)'>)}
        {
          (SQ <'rm -f o e &&\n'> 
            <'\t git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e &&\n'> <'\t test '>
          ) (DQ ($ Id.VSub_DollarName C)) (SQ <' = $(cat o) &&\n'> <'\t test "" = "$(cat e)"'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'Query "master@{May 26 2005 23:32:30}" (first non-creation change)'>)}
        {
          (SQ <'rm -f o e &&\n'> 
            <'\t git rev-parse --verify "master@{May 26 2005 23:32:30}" >o 2>e &&\n'> <'\t test '>
          ) (DQ ($ Id.VSub_DollarName A)) (SQ <' = $(cat o) &&\n'> <'\t test "" = "$(cat e)"'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'Query "master@{2005-05-26 23:33:01}" (middle of history with gap)'>)}
        {
          (SQ <'rm -f o e &&\n'> 
            <'\t git rev-parse --verify "master@{2005-05-26 23:33:01}" >o 2>e &&\n'> <'\t test '>
          ) (DQ ($ Id.VSub_DollarName B)) (SQ <' = $(cat o) &&\n'> <'\t test "warning: Log for ref '>) 
          (DQ ($ Id.VSub_DollarName m) <' has gap after '> ($ Id.VSub_DollarName gd)) (SQ <'." = "$(cat e)"'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'Query "master@{2005-05-26 23:38:00}" (middle of history)'>)}
        {
          (SQ <'rm -f o e &&\n'> 
            <'\t git rev-parse --verify "master@{2005-05-26 23:38:00}" >o 2>e &&\n'> <'\t test '>
          ) (DQ ($ Id.VSub_DollarName Z)) (SQ <' = $(cat o) &&\n'> <'\t test "" = "$(cat e)"'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'Query "master@{2005-05-26 23:43:00}" (exact end of history)'>)}
        {
          (SQ <'rm -f o e &&\n'> 
            <'\t git rev-parse --verify "master@{2005-05-26 23:43:00}" >o 2>e &&\n'> <'\t test '>
          ) (DQ ($ Id.VSub_DollarName E)) (SQ <' = $(cat o) &&\n'> <'\t test "" = "$(cat e)"'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'Query "master@{2005-05-28}" (past end of history)'>)}
        {
          (SQ <'rm -f o e &&\n'> <'\t git rev-parse --verify "master@{2005-05-28}" >o 2>e &&\n'> 
            <'\t test '>
          ) (DQ ($ Id.VSub_DollarName D)) (SQ <' = $(cat o) &&\n'> <'\t test "warning: Log for ref '>) 
          (DQ ($ Id.VSub_DollarName m) <' unexpectedly ended on '> ($ Id.VSub_DollarName ld)) (SQ <'." = "$(cat e)"'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <rm>
      more_env: []
      words: [
        {<rm>}
        {<-f>}
        {<'.git/'> ($ Id.VSub_DollarName m)}
        {<'.git/logs/'> ($ Id.VSub_DollarName m)}
        {<expect>}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'creating initial files'>)}
        {
          (SQ <'echo TEST >F &&\n'> <'     git add F &&\n'> 
            <'\t GIT_AUTHOR_DATE="2005-05-26 23:30" \\\n'> <'\t GIT_COMMITTER_DATE="2005-05-26 23:30" git commit -m add -a &&\n'> 
            <'\t h_TEST=$(git rev-parse --verify HEAD) &&\n'> <'\t echo The other day this did not work. >M &&\n'> 
            <'\t echo And then Bob told me how to fix it. >>M &&\n'> <'\t echo OTHER >F &&\n'> <'\t GIT_AUTHOR_DATE="2005-05-26 23:41" \\\n'> 
            <'\t GIT_COMMITTER_DATE="2005-05-26 23:41" git commit -F M -a &&\n'> <'\t h_OTHER=$(git rev-parse --verify HEAD) &&\n'> <'\t GIT_AUTHOR_DATE="2005-05-26 23:44" \\\n'> 
            <'\t GIT_COMMITTER_DATE="2005-05-26 23:44" git commit --amend &&\n'> <'\t h_FIXED=$(git rev-parse --verify HEAD) &&\n'> 
            <'\t echo Merged initial commit and a later commit. >M &&\n'> <'\t echo $h_TEST >.git/MERGE_HEAD &&\n'> <'\t GIT_AUTHOR_DATE="2005-05-26 23:45" \\\n'> 
            <'\t GIT_COMMITTER_DATE="2005-05-26 23:45" git commit -F M &&\n'> <'\t h_MERGED=$(git rev-parse --verify HEAD) &&\n'> <'\t rm -f M'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                ($ Id.VSub_DollarName Z)
                <' '>
                ($ Id.VSub_DollarName h_TEST)
                <' '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> 1117150200 +0000\tcommit (initial): add\n'>
                ($ Id.VSub_DollarName h_TEST)
                <' '>
                ($ Id.VSub_DollarName h_OTHER)
                <' '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> 1117150860 +0000\tcommit: The other day this did not work.\n'>
                ($ Id.VSub_DollarName h_OTHER)
                <' '>
                ($ Id.VSub_DollarName h_FIXED)
                <' '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> 1117151040 +0000\tcommit (amend): The other day this did not work.\n'>
                ($ Id.VSub_DollarName h_FIXED)
                <' '>
                ($ Id.VSub_DollarName h_MERGED)
                <' '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> 1117151100 +0000\tcommit (merge): Merged initial commit and a later commit.\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'git commit logged updates'>)}
        {(DQ <'test_cmp expect .git/logs/'> ($ Id.VSub_DollarName m))}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <unset>
      more_env: []
      words: [{<unset>} {<h_TEST>} {<h_OTHER>} {<h_FIXED>} {<h_MERGED>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'git cat-file blob master:F (expect OTHER)'>)}
        {(SQ <'test OTHER = $(git cat-file blob master:F)'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'git cat-file blob master@{2005-05-26 23:30}:F (expect TEST)'>)}
        {(SQ <'test TEST = $(git cat-file blob "master@{2005-05-26 23:30}:F")'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'git cat-file blob master@{2005-05-26 23:42}:F (expect OTHER)'>)}
        {(SQ <'test OTHER = $(git cat-file blob "master@{2005-05-26 23:42}:F")'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'a='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'a='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'a='> name:a)
          op: assign_op.Equal
          rhs: {<'refs/heads/a'>}
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'b='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'b='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'b='> name:b)
          op: assign_op.Equal
          rhs: {<'refs/heads/b'>}
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'c='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'c='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'c='> name:c)
          op: assign_op.Equal
          rhs: {<'refs/heads/c'>}
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'E='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'E='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'E='> name:E)
          op: assign_op.Equal
          rhs: {(SQ <'""'>)}
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'F='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'F='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'F='> name:F)
          op: assign_op.Equal
          rhs: {(SQ <'%s\\0'>)}
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'pws='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'pws='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'pws='> name:pws)
          op: assign_op.Equal
          rhs: {(SQ <'path with space'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin test setup'>)}
        {
          (SQ <'\n'> <'\techo "$pws" >"$pws" &&\n'> <'\tgit add -- "$pws" &&\n'> 
            <'\tgit commit -m "$pws"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'-z fails without --stdin'>)}
        {
          (SQ <'\n'> <'\ttest_must_fail git update-ref -z $m $m $m 2>err &&\n'> 
            <'\ttest_i18ngrep "usage: git update-ref" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin works with no input'>)}
        {
          (SQ <'\n'> <'\t>stdin &&\n'> <'\tgit update-ref --stdin <stdin &&\n'> 
            <'\tgit rev-parse --verify -q $m\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails on empty line'>)}
        {
          (SQ <'\n'> <'\techo "" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: empty command in input" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails on only whitespace'>)}
        {
          (SQ <'\n'> <'\techo " " >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: whitespace before command:  " err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails on leading whitespace'>)}
        {
          (SQ <'\n'> <'\techo " create $a $m" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: whitespace before command:  create $a $m" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails on unknown command'>)}
        {
          (SQ <'\n'> <'\techo "unknown $a" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: unknown command: unknown $a" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails on unbalanced quotes'>)}
        {
          (SQ <'\n'> <'\techo "create $a \\"master" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: badly quoted argument: \\\\\\"master" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails on invalid escape'>)}
        {
          (SQ <'\n'> <'\techo "create $a \\"ma\\zter\\"" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: badly quoted argument: \\\\\\"ma\\\\\\\\zter\\\\\\"" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails on junk after quoted argument'>)}
        {
          (SQ <'\n'> <'\techo "create \\"$a\\"master" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: unexpected character after quoted argument: \\\\\\"$a\\\\\\"master" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails create with no ref'>)}
        {
          (SQ <'\n'> <'\techo "create " >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: create: missing <ref>" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails create with no new value'>)}
        {
          (SQ <'\n'> <'\techo "create $a" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: create $a: missing <newvalue>" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails create with too many arguments'>)}
        {
          (SQ <'\n'> <'\techo "create $a $m $m" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: create $a: extra input:  $m" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails update with no ref'>)}
        {
          (SQ <'\n'> <'\techo "update " >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: update: missing <ref>" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails update with no new value'>)}
        {
          (SQ <'\n'> <'\techo "update $a" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: update $a: missing <newvalue>" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails update with too many arguments'>)}
        {
          (SQ <'\n'> <'\techo "update $a $m $m $m" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: update $a: extra input:  $m" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails delete with no ref'>)}
        {
          (SQ <'\n'> <'\techo "delete " >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: delete: missing <ref>" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails delete with too many arguments'>)}
        {
          (SQ <'\n'> <'\techo "delete $a $m $m" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: delete $a: extra input:  $m" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails verify with too many arguments'>)}
        {
          (SQ <'\n'> <'\techo "verify $a $m $m" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: verify $a: extra input:  $m" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails option with unknown name'>)}
        {
          (SQ <'\n'> <'\techo "option unknown" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: option unknown: unknown" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin fails with duplicate refs'>)}
        {
          (SQ <'\n'> <'\tcat >stdin <<-EOF &&\n'> <'\tcreate $a $m\n'> <'\tcreate $b $m\n'> 
            <'\tcreate $a $m\n'> <'\tEOF\n'> <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> 
            <'\tgrep "fatal: multiple updates for ref '>
          ) (DQ <'\''>) (SQ <'$a'>) (DQ <'\''>) (SQ <' not allowed." err\n'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin create ref works'>)}
        {
          (SQ <'\n'> <'\techo "create $a $m" >stdin &&\n'> <'\tgit update-ref --stdin <stdin &&\n'> 
            <'\tgit rev-parse $m >expect &&\n'> <'\tgit rev-parse $a >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 <'stdin does not create reflogs by default'>)}
        {
          (SQ <'\n'> <'\ttest_when_finished "git update-ref -d $outside" &&\n'> 
            <'\techo "create $outside $m" >stdin &&\n'> <'\tgit update-ref --stdin <stdin &&\n'> <'\tgit rev-parse $m >expect &&\n'> 
            <'\tgit rev-parse $outside >actual &&\n'> <'\ttest_cmp expect actual &&\n'> <'\ttest_must_fail git reflog exists $outside\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin creates reflogs with --create-reflog'>)}
        {
          (SQ <'\n'> <'\techo "create $outside $m" >stdin &&\n'> 
            <'\tgit update-ref --create-reflog --stdin <stdin &&\n'> <'\tgit rev-parse $m >expect &&\n'> <'\tgit rev-parse $outside >actual &&\n'> 
            <'\ttest_cmp expect actual &&\n'> <'\tgit reflog exists $outside\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin succeeds with quoted argument'>)}
        {
          (SQ <'\n'> <'\tgit update-ref -d $a &&\n'> <'\techo "create $a \\"$m\\"" >stdin &&\n'> 
            <'\tgit update-ref --stdin <stdin &&\n'> <'\tgit rev-parse $m >expect &&\n'> <'\tgit rev-parse $a >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 <'stdin succeeds with escaped character'>)}
        {
          (SQ <'\n'> <'\tgit update-ref -d $a &&\n'> 
            <'\techo "create $a \\"ma\\\\163ter\\"" >stdin &&\n'> <'\tgit update-ref --stdin <stdin &&\n'> <'\tgit rev-parse $m >expect &&\n'> 
            <'\tgit rev-parse $a >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 <'stdin update ref creates with zero old value'>)}
        {
          (SQ <'\n'> <'\techo "update $b $m $Z" >stdin &&\n'> <'\tgit update-ref --stdin <stdin &&\n'> 
            <'\tgit rev-parse $m >expect &&\n'> <'\tgit rev-parse $b >actual &&\n'> <'\ttest_cmp expect actual &&\n'> <'\tgit update-ref -d $b\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin update ref creates with empty old value'>)}
        {
          (SQ <'\n'> <'\techo "update $b $m $E" >stdin &&\n'> <'\tgit update-ref --stdin <stdin &&\n'> 
            <'\tgit rev-parse $m >expect &&\n'> <'\tgit rev-parse $b >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 <'stdin create ref works with path with space to blob'>)}
        {
          (SQ <'\n'> <'\techo "create refs/blobs/pws \\"$m:$pws\\"" >stdin &&\n'> 
            <'\tgit update-ref --stdin <stdin &&\n'> <'\tgit rev-parse "$m:$pws" >expect &&\n'> <'\tgit rev-parse refs/blobs/pws >actual &&\n'> 
            <'\ttest_cmp expect actual &&\n'> <'\tgit update-ref -d refs/blobs/pws\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin update ref fails with wrong old value'>)}
        {
          (SQ <'\n'> <'\techo "update $c $m $m~1" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: cannot lock ref '>
          ) (DQ <'\''>) (SQ <'$c'>) (DQ <'\''>) 
          (SQ <'" err &&\n'> <'\ttest_must_fail git rev-parse --verify -q $c\n'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin update ref fails with bad old value'>)}
        {
          (SQ <'\n'> <'\techo "update $c $m does-not-exist" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: update $c: invalid <oldvalue>: does-not-exist" err &&\n'> 
            <'\ttest_must_fail git rev-parse --verify -q $c\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin create ref fails with bad new value'>)}
        {
          (SQ <'\n'> <'\techo "create $c does-not-exist" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: create $c: invalid <newvalue>: does-not-exist" err &&\n'> 
            <'\ttest_must_fail git rev-parse --verify -q $c\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin create ref fails with zero new value'>)}
        {
          (SQ <'\n'> <'\techo "create $c " >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: create $c: zero <newvalue>" err &&\n'> 
            <'\ttest_must_fail git rev-parse --verify -q $c\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin update ref works with right old value'>)}
        {
          (SQ <'\n'> <'\techo "update $b $m~1 $m" >stdin &&\n'> 
            <'\tgit update-ref --stdin <stdin &&\n'> <'\tgit rev-parse $m~1 >expect &&\n'> <'\tgit rev-parse $b >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 <'stdin delete ref fails with wrong old value'>)}
        {
          (SQ <'\n'> <'\techo "delete $a $m~1" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: cannot lock ref '>
          ) (DQ <'\''>) (SQ <'$a'>) (DQ <'\''>) 
          (SQ <'" err &&\n'> <'\tgit rev-parse $m >expect &&\n'> <'\tgit rev-parse $a >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 <'stdin delete ref fails with zero old value'>)}
        {
          (SQ <'\n'> <'\techo "delete $a " >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: delete $a: zero <oldvalue>" err &&\n'> <'\tgit rev-parse $m >expect &&\n'> 
            <'\tgit rev-parse $a >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 <'stdin update symref works option no-deref'>)}
        {
          (SQ <'\n'> <'\tgit symbolic-ref TESTSYMREF $b &&\n'> <'\tcat >stdin <<-EOF &&\n'> 
            <'\toption no-deref\n'> <'\tupdate TESTSYMREF $a $b\n'> <'\tEOF\n'> <'\tgit update-ref --stdin <stdin &&\n'> 
            <'\tgit rev-parse TESTSYMREF >expect &&\n'> <'\tgit rev-parse $a >actual &&\n'> <'\ttest_cmp expect actual &&\n'> 
            <'\tgit rev-parse $m~1 >expect &&\n'> <'\tgit rev-parse $b >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 <'stdin delete symref works option no-deref'>)}
        {
          (SQ <'\n'> <'\tgit symbolic-ref TESTSYMREF $b &&\n'> <'\tcat >stdin <<-EOF &&\n'> 
            <'\toption no-deref\n'> <'\tdelete TESTSYMREF $b\n'> <'\tEOF\n'> <'\tgit update-ref --stdin <stdin &&\n'> 
            <'\ttest_must_fail git rev-parse --verify -q TESTSYMREF &&\n'> <'\tgit rev-parse $m~1 >expect &&\n'> <'\tgit rev-parse $b >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 <'stdin delete ref works with right old value'>)}
        {
          (SQ <'\n'> <'\techo "delete $b $m~1" >stdin &&\n'> <'\tgit update-ref --stdin <stdin &&\n'> 
            <'\ttest_must_fail git rev-parse --verify -q $b\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin update/create/verify combination works'>)}
        {
          (SQ <'\n'> <'\tcat >stdin <<-EOF &&\n'> <'\tupdate $a $m\n'> <'\tcreate $b $m\n'> 
            <'\tverify $c\n'> <'\tEOF\n'> <'\tgit update-ref --stdin <stdin &&\n'> <'\tgit rev-parse $m >expect &&\n'> 
            <'\tgit rev-parse $a >actual &&\n'> <'\ttest_cmp expect actual &&\n'> <'\tgit rev-parse $b >actual &&\n'> <'\ttest_cmp expect actual &&\n'> 
            <'\ttest_must_fail git rev-parse --verify -q $c\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin verify succeeds for correct value'>)}
        {
          (SQ <'\n'> <'\tgit rev-parse $m >expect &&\n'> <'\techo "verify $m $m" >stdin &&\n'> 
            <'\tgit update-ref --stdin <stdin &&\n'> <'\tgit rev-parse $m >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 <'stdin verify succeeds for missing reference'>)}
        {
          (SQ <'\n'> <'\techo "verify refs/heads/missing $Z" >stdin &&\n'> 
            <'\tgit update-ref --stdin <stdin &&\n'> <'\ttest_must_fail git rev-parse --verify -q refs/heads/missing\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin verify treats no value as missing'>)}
        {
          (SQ <'\n'> <'\techo "verify refs/heads/missing" >stdin &&\n'> 
            <'\tgit update-ref --stdin <stdin &&\n'> <'\ttest_must_fail git rev-parse --verify -q refs/heads/missing\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin verify fails for wrong value'>)}
        {
          (SQ <'\n'> <'\tgit rev-parse $m >expect &&\n'> <'\techo "verify $m $m~1" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin &&\n'> <'\tgit rev-parse $m >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 <'stdin verify fails for mistaken null value'>)}
        {
          (SQ <'\n'> <'\tgit rev-parse $m >expect &&\n'> <'\techo "verify $m $Z" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin &&\n'> <'\tgit rev-parse $m >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 <'stdin verify fails for mistaken empty value'>)}
        {
          (SQ <'\n'> <'\tM=$(git rev-parse $m) &&\n'> 
            <'\ttest_when_finished "git update-ref $m $M" &&\n'> <'\tgit rev-parse $m >expect &&\n'> <'\techo "verify $m" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin &&\n'> <'\tgit rev-parse $m >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 <'stdin update refs works with identity updates'>)}
        {
          (SQ <'\n'> <'\tcat >stdin <<-EOF &&\n'> <'\tupdate $a $m $m\n'> <'\tupdate $b $m $m\n'> 
            <'\tupdate $c $Z $E\n'> <'\tEOF\n'> <'\tgit update-ref --stdin <stdin &&\n'> <'\tgit rev-parse $m >expect &&\n'> 
            <'\tgit rev-parse $a >actual &&\n'> <'\ttest_cmp expect actual &&\n'> <'\tgit rev-parse $b >actual &&\n'> <'\ttest_cmp expect actual &&\n'> 
            <'\ttest_must_fail git rev-parse --verify -q $c\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin update refs fails with wrong old value'>)}
        {
          (SQ <'\n'> <'\tgit update-ref $c $m &&\n'> <'\tcat >stdin <<-EOF &&\n'> 
            <'\tupdate $a $m $m\n'> <'\tupdate $b $m $m\n'> <'\tupdate $c  '>
          ) 
          (SQ <'\n'> <'\tEOF\n'> <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> 
            <'\tgrep "fatal: cannot lock ref '>
          ) (DQ <'\''>) (SQ <'$c'>) (DQ <'\''>) 
          (SQ <'" err &&\n'> <'\tgit rev-parse $m >expect &&\n'> <'\tgit rev-parse $a >actual &&\n'> 
            <'\ttest_cmp expect actual &&\n'> <'\tgit rev-parse $b >actual &&\n'> <'\ttest_cmp expect actual &&\n'> 
            <'\tgit rev-parse $c >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 <'stdin delete refs works with packed and loose refs'>)}
        {
          (SQ <'\n'> <'\tgit pack-refs --all &&\n'> <'\tgit update-ref $c $m~1 &&\n'> 
            <'\tcat >stdin <<-EOF &&\n'> <'\tdelete $a $m\n'> <'\tupdate $b $Z $m\n'> <'\tupdate $c $E $m~1\n'> <'\tEOF\n'> 
            <'\tgit update-ref --stdin <stdin &&\n'> <'\ttest_must_fail git rev-parse --verify -q $a &&\n'> 
            <'\ttest_must_fail git rev-parse --verify -q $b &&\n'> <'\ttest_must_fail git rev-parse --verify -q $c\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z works on empty input'>)}
        {
          (SQ <'\n'> <'\t>stdin &&\n'> <'\tgit update-ref -z --stdin <stdin &&\n'> 
            <'\tgit rev-parse --verify -q $m\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails on empty line'>)}
        {
          (SQ <'\n'> <'\techo "" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: whitespace before command: " err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails on empty command'>)}
        {
          (SQ <'\n'> <'\tprintf $F "" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: empty command in input" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails on only whitespace'>)}
        {
          (SQ <'\n'> <'\tprintf $F " " >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: whitespace before command:  " err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails on leading whitespace'>)}
        {
          (SQ <'\n'> <'\tprintf $F " create $a" "$m" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: whitespace before command:  create $a" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails on unknown command'>)}
        {
          (SQ <'\n'> <'\tprintf $F "unknown $a" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: unknown command: unknown $a" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails create with no ref'>)}
        {
          (SQ <'\n'> <'\tprintf $F "create " >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: create: missing <ref>" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails create with no new value'>)}
        {
          (SQ <'\n'> <'\tprintf $F "create $a" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: create $a: unexpected end of input when reading <newvalue>" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails create with too many arguments'>)}
        {
          (SQ <'\n'> <'\tprintf $F "create $a" "$m" "$m" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: unknown command: $m" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails update with no ref'>)}
        {
          (SQ <'\n'> <'\tprintf $F "update " >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: update: missing <ref>" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails update with too few args'>)}
        {
          (SQ <'\n'> <'\tprintf $F "update $a" "$m" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: update $a: unexpected end of input when reading <oldvalue>" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z emits warning with empty new value'>)}
        {
          (SQ <'\n'> <'\tgit update-ref $a $m &&\n'> <'\tprintf $F "update $a" "" "" >stdin &&\n'> 
            <'\tgit update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "warning: update $a: missing <newvalue>, treating as zero" err &&\n'> 
            <'\ttest_must_fail git rev-parse --verify -q $a\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails update with no new value'>)}
        {
          (SQ <'\n'> <'\tprintf $F "update $a" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: update $a: unexpected end of input when reading <newvalue>" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails update with no old value'>)}
        {
          (SQ <'\n'> <'\tprintf $F "update $a" "$m" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: update $a: unexpected end of input when reading <oldvalue>" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails update with too many arguments'>)}
        {
          (SQ <'\n'> <'\tprintf $F "update $a" "$m" "$m" "$m" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: unknown command: $m" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails delete with no ref'>)}
        {
          (SQ <'\n'> <'\tprintf $F "delete " >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: delete: missing <ref>" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails delete with no old value'>)}
        {
          (SQ <'\n'> <'\tprintf $F "delete $a" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: delete $a: unexpected end of input when reading <oldvalue>" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails delete with too many arguments'>)}
        {
          (SQ <'\n'> <'\tprintf $F "delete $a" "$m" "$m" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: unknown command: $m" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails verify with too many arguments'>)}
        {
          (SQ <'\n'> <'\tprintf $F "verify $a" "$m" "$m" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: unknown command: $m" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails verify with no old value'>)}
        {
          (SQ <'\n'> <'\tprintf $F "verify $a" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: verify $a: unexpected end of input when reading <oldvalue>" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails option with unknown name'>)}
        {
          (SQ <'\n'> <'\tprintf $F "option unknown" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: option unknown: unknown" err\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z fails with duplicate refs'>)}
        {
          (SQ <'\n'> <'\tprintf $F "create $a" "$m" "create $b" "$m" "create $a" "$m" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: multiple updates for ref '>
          ) (DQ <'\''>) (SQ <'$a'>) (DQ <'\''>) (SQ <' not allowed." err\n'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z create ref works'>)}
        {
          (SQ <'\n'> <'\tprintf $F "create $a" "$m" >stdin &&\n'> 
            <'\tgit update-ref -z --stdin <stdin &&\n'> <'\tgit rev-parse $m >expect &&\n'> <'\tgit rev-parse $a >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 <'stdin -z update ref creates with zero old value'>)}
        {
          (SQ <'\n'> <'\tprintf $F "update $b" "$m" "$Z" >stdin &&\n'> 
            <'\tgit update-ref -z --stdin <stdin &&\n'> <'\tgit rev-parse $m >expect &&\n'> <'\tgit rev-parse $b >actual &&\n'> 
            <'\ttest_cmp expect actual &&\n'> <'\tgit update-ref -d $b\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z update ref creates with empty old value'>)}
        {
          (SQ <'\n'> <'\tprintf $F "update $b" "$m" "" >stdin &&\n'> 
            <'\tgit update-ref -z --stdin <stdin &&\n'> <'\tgit rev-parse $m >expect &&\n'> <'\tgit rev-parse $b >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 <'stdin -z create ref works with path with space to blob'>)}
        {
          (SQ <'\n'> <'\tprintf $F "create refs/blobs/pws" "$m:$pws" >stdin &&\n'> 
            <'\tgit update-ref -z --stdin <stdin &&\n'> <'\tgit rev-parse "$m:$pws" >expect &&\n'> <'\tgit rev-parse refs/blobs/pws >actual &&\n'> 
            <'\ttest_cmp expect actual &&\n'> <'\tgit update-ref -d refs/blobs/pws\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z update ref fails with wrong old value'>)}
        {
          (SQ <'\n'> <'\tprintf $F "update $c" "$m" "$m~1" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: cannot lock ref '>
          ) (DQ <'\''>) (SQ <'$c'>) (DQ <'\''>) 
          (SQ <'" err &&\n'> <'\ttest_must_fail git rev-parse --verify -q $c\n'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z update ref fails with bad old value'>)}
        {
          (SQ <'\n'> <'\tprintf $F "update $c" "$m" "does-not-exist" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: update $c: invalid <oldvalue>: does-not-exist" err &&\n'> 
            <'\ttest_must_fail git rev-parse --verify -q $c\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z create ref fails when ref exists'>)}
        {
          (SQ <'\n'> <'\tgit update-ref $c $m &&\n'> <'\tgit rev-parse "$c" >expect &&\n'> 
            <'\tprintf $F "create $c" "$m~1" >stdin &&\n'> <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: cannot lock ref '>
          ) (DQ <'\''>) (SQ <'$c'>) (DQ <'\''>) 
          (SQ <'" err &&\n'> <'\tgit rev-parse "$c" >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 <'stdin -z create ref fails with bad new value'>)}
        {
          (SQ <'\n'> <'\tgit update-ref -d "$c" &&\n'> 
            <'\tprintf $F "create $c" "does-not-exist" >stdin &&\n'> <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> 
            <'\tgrep "fatal: create $c: invalid <newvalue>: does-not-exist" err &&\n'> <'\ttest_must_fail git rev-parse --verify -q $c\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z create ref fails with empty new value'>)}
        {
          (SQ <'\n'> <'\tprintf $F "create $c" "" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: create $c: missing <newvalue>" err &&\n'> 
            <'\ttest_must_fail git rev-parse --verify -q $c\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z update ref works with right old value'>)}
        {
          (SQ <'\n'> <'\tprintf $F "update $b" "$m~1" "$m" >stdin &&\n'> 
            <'\tgit update-ref -z --stdin <stdin &&\n'> <'\tgit rev-parse $m~1 >expect &&\n'> <'\tgit rev-parse $b >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 <'stdin -z delete ref fails with wrong old value'>)}
        {
          (SQ <'\n'> <'\tprintf $F "delete $a" "$m~1" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: cannot lock ref '>
          ) (DQ <'\''>) (SQ <'$a'>) (DQ <'\''>) 
          (SQ <'" err &&\n'> <'\tgit rev-parse $m >expect &&\n'> <'\tgit rev-parse $a >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 <'stdin -z delete ref fails with zero old value'>)}
        {
          (SQ <'\n'> <'\tprintf $F "delete $a" "$Z" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: delete $a: zero <oldvalue>" err &&\n'> <'\tgit rev-parse $m >expect &&\n'> 
            <'\tgit rev-parse $a >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 <'stdin -z update symref works option no-deref'>)}
        {
          (SQ <'\n'> <'\tgit symbolic-ref TESTSYMREF $b &&\n'> 
            <'\tprintf $F "option no-deref" "update TESTSYMREF" "$a" "$b" >stdin &&\n'> <'\tgit update-ref -z --stdin <stdin &&\n'> <'\tgit rev-parse TESTSYMREF >expect &&\n'> 
            <'\tgit rev-parse $a >actual &&\n'> <'\ttest_cmp expect actual &&\n'> <'\tgit rev-parse $m~1 >expect &&\n'> 
            <'\tgit rev-parse $b >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 <'stdin -z delete symref works option no-deref'>)}
        {
          (SQ <'\n'> <'\tgit symbolic-ref TESTSYMREF $b &&\n'> 
            <'\tprintf $F "option no-deref" "delete TESTSYMREF" "$b" >stdin &&\n'> <'\tgit update-ref -z --stdin <stdin &&\n'> 
            <'\ttest_must_fail git rev-parse --verify -q TESTSYMREF &&\n'> <'\tgit rev-parse $m~1 >expect &&\n'> <'\tgit rev-parse $b >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 <'stdin -z delete ref works with right old value'>)}
        {
          (SQ <'\n'> <'\tprintf $F "delete $b" "$m~1" >stdin &&\n'> 
            <'\tgit update-ref -z --stdin <stdin &&\n'> <'\ttest_must_fail git rev-parse --verify -q $b\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z update/create/verify combination works'>)}
        {
          (SQ <'\n'> <'\tprintf $F "update $a" "$m" "" "create $b" "$m" "verify $c" "" >stdin &&\n'> 
            <'\tgit update-ref -z --stdin <stdin &&\n'> <'\tgit rev-parse $m >expect &&\n'> <'\tgit rev-parse $a >actual &&\n'> 
            <'\ttest_cmp expect actual &&\n'> <'\tgit rev-parse $b >actual &&\n'> <'\ttest_cmp expect actual &&\n'> 
            <'\ttest_must_fail git rev-parse --verify -q $c\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z verify succeeds for correct value'>)}
        {
          (SQ <'\n'> <'\tgit rev-parse $m >expect &&\n'> <'\tprintf $F "verify $m" "$m" >stdin &&\n'> 
            <'\tgit update-ref -z --stdin <stdin &&\n'> <'\tgit rev-parse $m >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 <'stdin -z verify succeeds for missing reference'>)}
        {
          (SQ <'\n'> <'\tprintf $F "verify refs/heads/missing" "$Z" >stdin &&\n'> 
            <'\tgit update-ref -z --stdin <stdin &&\n'> <'\ttest_must_fail git rev-parse --verify -q refs/heads/missing\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z verify treats no value as missing'>)}
        {
          (SQ <'\n'> <'\tprintf $F "verify refs/heads/missing" "" >stdin &&\n'> 
            <'\tgit update-ref -z --stdin <stdin &&\n'> <'\ttest_must_fail git rev-parse --verify -q refs/heads/missing\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z verify fails for wrong value'>)}
        {
          (SQ <'\n'> <'\tgit rev-parse $m >expect &&\n'> <'\tprintf $F "verify $m" "$m~1" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin &&\n'> <'\tgit rev-parse $m >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 <'stdin -z verify fails for mistaken null value'>)}
        {
          (SQ <'\n'> <'\tgit rev-parse $m >expect &&\n'> <'\tprintf $F "verify $m" "$Z" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin &&\n'> <'\tgit rev-parse $m >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 <'stdin -z verify fails for mistaken empty value'>)}
        {
          (SQ <'\n'> <'\tM=$(git rev-parse $m) &&\n'> 
            <'\ttest_when_finished "git update-ref $m $M" &&\n'> <'\tgit rev-parse $m >expect &&\n'> <'\tprintf $F "verify $m" "" >stdin &&\n'> 
            <'\ttest_must_fail git update-ref -z --stdin <stdin &&\n'> <'\tgit rev-parse $m >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 <'stdin -z update refs works with identity updates'>)}
        {
          (SQ <'\n'> 
            <
'\tprintf $F "update $a" "$m" "$m" "update $b" "$m" "$m" "update $c" "$Z" "" >stdin &&\n'
            > <'\tgit update-ref -z --stdin <stdin &&\n'> <'\tgit rev-parse $m >expect &&\n'> 
            <'\tgit rev-parse $a >actual &&\n'> <'\ttest_cmp expect actual &&\n'> <'\tgit rev-parse $b >actual &&\n'> <'\ttest_cmp expect actual &&\n'> 
            <'\ttest_must_fail git rev-parse --verify -q $c\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'stdin -z update refs fails with wrong old value'>)}
        {
          (SQ <'\n'> <'\tgit update-ref $c $m &&\n'> 
            <
'\tprintf $F "update $a" "$m" "$m" "update $b" "$m" "$m" "update $c" "$m" "$Z" >stdin &&\n'
            > <'\ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: cannot lock ref '>
          ) (DQ <'\''>) (SQ <'$c'>) (DQ <'\''>) 
          (SQ <'" err &&\n'> <'\tgit rev-parse $m >expect &&\n'> <'\tgit rev-parse $a >actual &&\n'> 
            <'\ttest_cmp expect actual &&\n'> <'\tgit rev-parse $b >actual &&\n'> <'\ttest_cmp expect actual &&\n'> 
            <'\tgit rev-parse $c >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 <'stdin -z delete refs works with packed and loose refs'>)}
        {
          (SQ <'\n'> <'\tgit pack-refs --all &&\n'> <'\tgit update-ref $c $m~1 &&\n'> 
            <'\tprintf $F "delete $a" "$m" "update $b" "$Z" "$m" "update $c" "" "$m~1" >stdin &&\n'> <'\tgit update-ref -z --stdin <stdin &&\n'> <'\ttest_must_fail git rev-parse --verify -q $a &&\n'> 
            <'\ttest_must_fail git rev-parse --verify -q $b &&\n'> <'\ttest_must_fail git rev-parse --verify -q $c\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'fails with duplicate HEAD update'>)}
        {
          (SQ <'\n'> <'\tgit branch target1 $A &&\n'> <'\tgit checkout target1 &&\n'> 
            <'\tcat >stdin <<-EOF &&\n'> <'\tupdate refs/heads/target1 $C\n'> <'\toption no-deref\n'> <'\tupdate HEAD $B\n'> <'\tEOF\n'> 
            <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: multiple updates for '>
          ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''> ch:'\'') (SQ <HEAD>) 
          (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''> ch:'\'') 
          (SQ <' (including one via its referent .refs/heads/target1.) are not allowed" err &&\n'> 
            <'\techo "refs/heads/target1" >expect &&\n'> <'\tgit symbolic-ref HEAD >actual &&\n'> <'\ttest_cmp expect actual &&\n'> <'\techo "$A" >expect &&\n'> 
            <'\tgit rev-parse refs/heads/target1 >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 <'fails with duplicate ref update via symref'>)}
        {
          (SQ <'\n'> <'\tgit branch target2 $A &&\n'> 
            <'\tgit symbolic-ref refs/heads/symref2 refs/heads/target2 &&\n'> <'\tcat >stdin <<-EOF &&\n'> <'\tupdate refs/heads/target2 $C\n'> <'\tupdate refs/heads/symref2 $B\n'> 
            <'\tEOF\n'> <'\ttest_must_fail git update-ref --stdin <stdin 2>err &&\n'> <'\tgrep "fatal: multiple updates for '>
          ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''> ch:'\'') (SQ <'refs/heads/target2'>) 
          (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''> ch:'\'') 
          (SQ <' (including one via symref .refs/heads/symref2.) are not allowed" err &&\n'> 
            <'\techo "refs/heads/target2" >expect &&\n'> <'\tgit symbolic-ref refs/heads/symref2 >actual &&\n'> <'\ttest_cmp expect actual &&\n'> 
            <'\techo "$A" >expect &&\n'> <'\tgit rev-parse refs/heads/target2 >actual &&\n'> <'\ttest_cmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.ShFunction
      name_tok: <run_with_limited_open_files>
      name: run_with_limited_open_files
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Subshell
              left: <Id.Op_LParen _>
              child: 
                (command.AndOr
                  children: [
                    (command.Simple
                      blame_tok: <ulimit>
                      more_env: []
                      words: [{<ulimit>} {<-n>} {<32>}]
                      redirects: []
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <Id.Left_DoubleQuote '"'>
                      more_env: []
                      words: [{(DQ ($ Id.VSub_At '@'))}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  ops: [<Id.Op_DAmp _>]
                )
              right: <Id.Right_Subshell _>
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <test_lazy_prereq>
      more_env: []
      words: [
        {<test_lazy_prereq>}
        {<ULIMIT_FILE_DESCRIPTORS>}
        {(SQ <'run_with_limited_open_files true'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<ULIMIT_FILE_DESCRIPTORS>}
        {(SQ <'large transaction creating branches does not burst open file limit'>)}
        {
          (SQ <'\n'> <'(\n'> <'\tfor i in $(test_seq 33)\n'> <'\tdo\n'> 
            <'\t\techo "create refs/heads/$i HEAD"\n'> <'\tdone >large_input &&\n'> 
            <'\trun_with_limited_open_files git update-ref --stdin <large_input &&\n'> <'\tgit rev-parse --verify -q refs/heads/33\n'> <')\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<ULIMIT_FILE_DESCRIPTORS>}
        {(SQ <'large transaction deleting branches does not burst open file limit'>)}
        {
          (SQ <'\n'> <'(\n'> <'\tfor i in $(test_seq 33)\n'> <'\tdo\n'> 
            <'\t\techo "delete refs/heads/$i HEAD"\n'> <'\tdone >large_input &&\n'> 
            <'\trun_with_limited_open_files git update-ref --stdin <large_input &&\n'> <'\ttest_must_fail git rev-parse --verify -q refs/heads/33\n'> <')\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'handle per-worktree refs in refs/bisect'>)}
        {
          (SQ <'\n'> <'\tgit commit --allow-empty -m "initial commit" &&\n'> 
            <'\tgit worktree add -b branch worktree &&\n'> <'\t(\n'> <'\t\tcd worktree &&\n'> <'\t\tgit commit --allow-empty -m "test commit"  &&\n'> 
            <'\t\tgit for-each-ref >for-each-ref.out &&\n'> <'\t\t! grep refs/bisect for-each-ref.out &&\n'> 
            <'\t\tgit update-ref refs/bisect/something HEAD &&\n'> <'\t\tgit rev-parse refs/bisect/something >../worktree-head &&\n'> 
            <'\t\tgit for-each-ref | grep refs/bisect/something\n'> <'\t) &&\n'> <'\ttest_path_is_missing .git/refs/bisect &&\n'> 
            <'\ttest_must_fail git rev-parse refs/bisect/something &&\n'> <'\tgit update-ref refs/bisect/something HEAD &&\n'> 
            <'\tgit rev-parse refs/bisect/something >main-head &&\n'> <'\t! test_cmp main-head worktree-head\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)