(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: 
            {
              (SQ (Token id:Id.Lit_Chars val:'Basic fetch/push functionality.\n' span_id:6) 
                (Token id:Id.Lit_Chars val:'\n' span_id:7) (Token id:Id.Lit_Chars val:'This test checks the following functionality:\n' span_id:8) 
                (Token id:Id.Lit_Chars val:'\n' span_id:9) (Token id:Id.Lit_Chars val:'* command-line syntax\n' span_id:10) 
                (Token id:Id.Lit_Chars val:'* refspecs\n' span_id:11) (Token id:Id.Lit_Chars val:'* fast-forward detection, and overriding it\n' span_id:12) 
                (Token id:Id.Lit_Chars val:'* configuration\n' span_id:13) (Token id:Id.Lit_Chars val:'* hooks\n' span_id:14) 
                (Token
                  id: Id.Lit_Chars
                  val: '* --porcelain output format\n'
                  span_id: 15
                ) (Token id:Id.Lit_Chars val:'* hiderefs\n' span_id:16) 
                (Token id:Id.Lit_Chars val:'* reflogs\n' span_id:17)
              )
            }
          spids: [4]
        )
      ]
    )
    (C {(.)} {(./test-lib.sh)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:D)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:27)
                command_list: (command.CommandList children:[(C {(pwd)})])
              )
            }
          spids: [26]
        )
      ]
    )
    (command.ShFunction
      name: mk_empty
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:repo_name)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [40]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {(rm)} {(-fr)} {(DQ ($ Id.VSub_DollarName '$repo_name'))})
                (C {(mkdir)} {(DQ ($ Id.VSub_DollarName '$repo_name'))})
                (command.Subshell
                  command_list: 
                    (command.CommandList
                      children: [
                        (command.AndOr
                          ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
                          children: [
                            (C {(cd)} {(DQ ($ Id.VSub_DollarName '$repo_name'))})
                            (C {(git)} {(init)})
                            (C {(git)} {(config)} {(receive.denyCurrentBranch)} {(warn)})
                            (C {(mv)} {(.git/hooks)} {(.git/hooks-disabled)})
                          ]
                        )
                      ]
                    )
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: mk_test
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:repo_name)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [116]
                )
              ]
            )
            (C {(shift)})
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {(mk_empty)} {(DQ ($ Id.VSub_DollarName '$repo_name'))})
                (command.Subshell
                  command_list: 
                    (command.CommandList
                      children: [
                        (command.AndOr
                          ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
                          children: [
                            (command.ForEach
                              iter_name: ref
                              iter_words: [{(DQ ($ Id.VSub_At '$@'))}]
                              do_arg_iter: F
                              body: 
                                (command.DoGroup
                                  children: [
                                    (command.AndOr
                                      ops: [Id.Op_DPipe]
                                      children: [
                                        (C {(git)} {(push)} {(DQ ($ Id.VSub_DollarName '$repo_name'))} 
                                          {($ Id.VSub_DollarName '$the_first_commit') 
                                            (Id.Lit_Other ':') (refs/) ($ Id.VSub_DollarName '$ref')
                                          }
                                        )
                                        (command.ControlFlow
                                          token: (Token id:Id.ControlFlow_Exit val:exit span_id:168)
                                        )
                                      ]
                                    )
                                  ]
                                )
                            )
                            (C {(cd)} {(DQ ($ Id.VSub_DollarName '$repo_name'))})
                            (command.ForEach
                              iter_name: ref
                              iter_words: [{(DQ ($ Id.VSub_At '$@'))}]
                              do_arg_iter: F
                              body: 
                                (command.DoGroup
                                  children: [
                                    (command.AndOr
                                      ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DPipe]
                                      children: [
                                        (command.Simple
                                          words: [
                                            {(echo)}
                                            {(DQ ($ Id.VSub_DollarName '$the_first_commit'))}
                                          ]
                                          redirects: [
                                            (redir.Redir
                                              op: (Token id:Id.Redir_Great val:'>' span_id:205)
                                              fd: -1
                                              arg_word: {(expect)}
                                            )
                                          ]
                                        )
                                        (command.Simple
                                          words: [
                                            {(git)}
                                            {(show-ref)}
                                            {(-s)}
                                            {(--verify)}
                                            {(refs/) ($ Id.VSub_DollarName '$ref')}
                                          ]
                                          redirects: [
                                            (redir.Redir
                                              op: (Token id:Id.Redir_Great val:'>' span_id:222)
                                              fd: -1
                                              arg_word: {(actual)}
                                            )
                                          ]
                                        )
                                        (C {(test_cmp)} {(expect)} {(actual)})
                                        (command.ControlFlow
                                          token: (Token id:Id.ControlFlow_Exit val:exit span_id:237)
                                        )
                                      ]
                                    )
                                  ]
                                )
                            )
                            (C {(git)} {(fsck)} {(--full)})
                          ]
                        )
                      ]
                    )
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: mk_test_with_hooks
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:repo_name)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [264]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {(mk_test)} {(DQ ($ Id.VSub_At '$@'))})
                (command.Subshell
                  command_list: 
                    (command.CommandList
                      children: [
                        (command.AndOr
                          ops: [
                            Id.Op_DAmp
                            Id.Op_DAmp
                            Id.Op_DAmp
                            Id.Op_DAmp
                            Id.Op_DAmp
                            Id.Op_DAmp
                            Id.Op_DAmp
                          ]
                          children: [
                            (C {(cd)} {(DQ ($ Id.VSub_DollarName '$repo_name'))})
                            (C {(mkdir)} {(.git/hooks)})
                            (C {(cd)} {(.git/hooks)})
                            (command.Simple
                              words: [{(cat)}]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_Great val:'>' span_id:306)
                                  fd: -1
                                  arg_word: {(pre-receive)}
                                )
                                (redir.HereDoc
                                  op: (Token id:Id.Redir_DLessDash val:'<<-' span_id:309)
                                  fd: -1
                                  here_begin: {(SQ (Token id:Id.Lit_Chars val:EOF span_id:311))}
                                  here_end_span_id: 318
                                  stdin_parts: [('#!/bin/sh\n') ('cat - >>pre-receive.actual\n')]
                                )
                              ]
                            )
                            (command.Simple
                              words: [{(cat)}]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_Great val:'>' span_id:323)
                                  fd: -1
                                  arg_word: {(update)}
                                )
                                (redir.HereDoc
                                  op: (Token id:Id.Redir_DLessDash val:'<<-' span_id:326)
                                  fd: -1
                                  here_begin: {(SQ (Token id:Id.Lit_Chars val:EOF span_id:328))}
                                  here_end_span_id: 335
                                  stdin_parts: [
                                    ('#!/bin/sh\n')
                                    ('printf "%s %s %s\\n" "$@" >>update.actual\n')
                                  ]
                                )
                              ]
                            )
                            (command.Simple
                              words: [{(cat)}]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_Great val:'>' span_id:340)
                                  fd: -1
                                  arg_word: {(post-receive)}
                                )
                                (redir.HereDoc
                                  op: (Token id:Id.Redir_DLessDash val:'<<-' span_id:343)
                                  fd: -1
                                  here_begin: {(SQ (Token id:Id.Lit_Chars val:EOF span_id:345))}
                                  here_end_span_id: 352
                                  stdin_parts: [('#!/bin/sh\n') ('cat - >>post-receive.actual\n')]
                                )
                              ]
                            )
                            (command.Simple
                              words: [{(cat)}]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_Great val:'>' span_id:357)
                                  fd: -1
                                  arg_word: {(post-update)}
                                )
                                (redir.HereDoc
                                  op: (Token id:Id.Redir_DLessDash val:'<<-' span_id:360)
                                  fd: -1
                                  here_begin: {(SQ (Token id:Id.Lit_Chars val:EOF span_id:362))}
                                  here_end_span_id: 372
                                  stdin_parts: [
                                    ('#!/bin/sh\n')
                                    ('for ref in "$@"\n')
                                    ('do\n')
                                    ('printf "%s\\n" "$ref" >>post-update.actual\n')
                                    ('done\n')
                                  ]
                                )
                              ]
                            )
                            (C {(chmod)} {(Id.Lit_Other '+') (x)} {(pre-receive)} {(update)} 
                              {(post-receive)} {(post-update)}
                            )
                          ]
                        )
                      ]
                    )
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: mk_child
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {(rm)} {(-rf)} {(DQ ($ Id.VSub_Number '$2'))})
                (C {(git)} {(clone)} {(DQ ($ Id.VSub_Number '$1'))} {(DQ ($ Id.VSub_Number '$2'))})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: check_push_result
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:repo_name)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [435]
                )
              ]
            )
            (C {(shift)})
            (command.Subshell
              command_list: 
                (command.CommandList
                  children: [
                    (command.AndOr
                      ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
                      children: [
                        (C {(cd)} {(DQ ($ Id.VSub_DollarName '$repo_name'))})
                        (command.Simple
                          words: [{(echo)} {(DQ ($ Id.VSub_Number '$1'))}]
                          redirects: [
                            (redir.Redir
                              op: (Token id:Id.Redir_Great val:'>' span_id:463)
                              fd: -1
                              arg_word: {(expect)}
                            )
                          ]
                        )
                        (C {(shift)})
                        (command.ForEach
                          iter_name: ref
                          iter_words: [{(DQ ($ Id.VSub_At '$@'))}]
                          do_arg_iter: F
                          body: 
                            (command.DoGroup
                              children: [
                                (command.AndOr
                                  ops: [Id.Op_DAmp Id.Op_DPipe]
                                  children: [
                                    (command.Simple
                                      words: [
                                        {(git)}
                                        {(show-ref)}
                                        {(-s)}
                                        {(--verify)}
                                        {(refs/) ($ Id.VSub_DollarName '$ref')}
                                      ]
                                      redirects: [
                                        (redir.Redir
                                          op: (Token id:Id.Redir_Great val:'>' span_id:499)
                                          fd: -1
                                          arg_word: {(actual)}
                                        )
                                      ]
                                    )
                                    (C {(test_cmp)} {(expect)} {(actual)})
                                    (command.ControlFlow
                                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:514)
                                    )
                                  ]
                                )
                              ]
                            )
                        )
                        (C {(git)} {(fsck)} {(--full)})
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (C {(test_expect_success)} {(setup)} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:539) (Token id:Id.Lit_Chars val:'\n' span_id:540) 
          (Token id:Id.Lit_Chars val:'\t>path1 &&\n' span_id:541) (Token id:Id.Lit_Chars val:'\tgit add path1 &&\n' span_id:542) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:543) (Token id:Id.Lit_Chars val:'\tgit commit -a -m repo &&\n' span_id:544) 
          (Token
            id: Id.Lit_Chars
            val: '\tthe_first_commit=$(git show-ref -s --verify refs/heads/master) &&\n'
            span_id: 545
          ) (Token id:Id.Lit_Chars val:'\n' span_id:546) (Token id:Id.Lit_Chars val:'\t>path2 &&\n' span_id:547) 
          (Token id:Id.Lit_Chars val:'\tgit add path2 &&\n' span_id:548) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:549) 
          (Token id:Id.Lit_Chars val:'\tgit commit -a -m second &&\n' span_id:550) 
          (Token
            id: Id.Lit_Chars
            val: '\tthe_commit=$(git show-ref -s --verify refs/heads/master)\n'
            span_id: 551
          ) (Token id:Id.Lit_Chars val:'\n' span_id:552)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch without wildcard' span_id:559))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:563) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:564) (Token id:Id.Lit_Chars val:'\t(\n' span_id:565) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:566) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit fetch .. refs/heads/master:refs/remotes/origin/master &&\n'
            span_id: 567
          ) (Token id:Id.Lit_Chars val:'\n' span_id:568) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "$the_commit commit\trefs/remotes/origin/master" >expect &&\n'
            span_id: 569
          ) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref refs/remotes/origin >actual &&\n' span_id:570) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:571) (Token id:Id.Lit_Chars val:'\t)\n' span_id:572)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch with wildcard' span_id:579))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:583) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:584) (Token id:Id.Lit_Chars val:'\t(\n' span_id:585) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:586) (Token id:Id.Lit_Chars val:'\t\tgit config remote.up.url .. &&\n' span_id:587) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&\n'
            span_id: 588
          ) (Token id:Id.Lit_Chars val:'\t\tgit fetch up &&\n' span_id:589) 
          (Token id:Id.Lit_Chars val:'\n' span_id:590) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "$the_commit commit\trefs/remotes/origin/master" >expect &&\n'
            span_id: 591
          ) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref refs/remotes/origin >actual &&\n' span_id:592) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:593) (Token id:Id.Lit_Chars val:'\t)\n' span_id:594)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch with insteadOf' span_id:601))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:605) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:606) (Token id:Id.Lit_Chars val:'\t(\n' span_id:607) 
          (Token id:Id.Lit_Chars val:'\t\tTRASH=$(pwd)/ &&\n' span_id:608) (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:609) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config "url.$TRASH.insteadOf" trash/ &&\n'
            span_id: 610
          ) (Token id:Id.Lit_Chars val:'\t\tgit config remote.up.url trash/. &&\n' span_id:611) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&\n'
            span_id: 612
          ) (Token id:Id.Lit_Chars val:'\t\tgit fetch up &&\n' span_id:613) 
          (Token id:Id.Lit_Chars val:'\n' span_id:614) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "$the_commit commit\trefs/remotes/origin/master" >expect &&\n'
            span_id: 615
          ) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref refs/remotes/origin >actual &&\n' span_id:616) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:617) (Token id:Id.Lit_Chars val:'\t)\n' span_id:618)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'fetch with pushInsteadOf (should not rewrite)' span_id:625))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:629) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:630) (Token id:Id.Lit_Chars val:'\t(\n' span_id:631) 
          (Token id:Id.Lit_Chars val:'\t\tTRASH=$(pwd)/ &&\n' span_id:632) (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:633) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config "url.trash/.pushInsteadOf" "$TRASH" &&\n'
            span_id: 634
          ) (Token id:Id.Lit_Chars val:'\t\tgit config remote.up.url "$TRASH." &&\n' span_id:635) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&\n'
            span_id: 636
          ) (Token id:Id.Lit_Chars val:'\t\tgit fetch up &&\n' span_id:637) 
          (Token id:Id.Lit_Chars val:'\n' span_id:638) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "$the_commit commit\trefs/remotes/origin/master" >expect &&\n'
            span_id: 639
          ) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref refs/remotes/origin >actual &&\n' span_id:640) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:641) (Token id:Id.Lit_Chars val:'\t)\n' span_id:642)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'push without wildcard' span_id:649))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:653) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:654) (Token id:Id.Lit_Chars val:'\n' span_id:655) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push testrepo refs/heads/master:refs/remotes/origin/master &&\n'
            span_id: 656
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:657) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:658) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "$the_commit commit\trefs/remotes/origin/master" >expect &&\n'
            span_id: 659
          ) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref refs/remotes/origin >actual &&\n' span_id:660) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:661) (Token id:Id.Lit_Chars val:'\t)\n' span_id:662)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'push with wildcard' span_id:669))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:673) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:674) (Token id:Id.Lit_Chars val:'\n' span_id:675) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push testrepo "refs/heads/*:refs/remotes/origin/*" &&\n'
            span_id: 676
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:677) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:678) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "$the_commit commit\trefs/remotes/origin/master" >expect &&\n'
            span_id: 679
          ) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref refs/remotes/origin >actual &&\n' span_id:680) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:681) (Token id:Id.Lit_Chars val:'\t)\n' span_id:682)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'push with insteadOf' span_id:689))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:693) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:694) (Token id:Id.Lit_Chars val:'\tTRASH="$(pwd)/" &&\n' span_id:695) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config "url.$TRASH.insteadOf" trash/ &&\n'
            span_id: 696
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push trash/testrepo refs/heads/master:refs/remotes/origin/master &&\n'
            span_id: 697
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:698) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:699) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "$the_commit commit\trefs/remotes/origin/master" >expect &&\n'
            span_id: 700
          ) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref refs/remotes/origin >actual &&\n' span_id:701) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:702) (Token id:Id.Lit_Chars val:'\t)\n' span_id:703)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'push with pushInsteadOf' span_id:710))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:714) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:715) (Token id:Id.Lit_Chars val:'\tTRASH="$(pwd)/" &&\n' span_id:716) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config "url.$TRASH.pushInsteadOf" trash/ &&\n'
            span_id: 717
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push trash/testrepo refs/heads/master:refs/remotes/origin/master &&\n'
            span_id: 718
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:719) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:720) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "$the_commit commit\trefs/remotes/origin/master" >expect &&\n'
            span_id: 721
          ) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref refs/remotes/origin >actual &&\n' span_id:722) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:723) (Token id:Id.Lit_Chars val:'\t)\n' span_id:724)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'push with pushInsteadOf and explicit pushurl (pushInsteadOf should not rewrite)'
            span_id: 731
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:735) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:736) (Token id:Id.Lit_Chars val:'\ttest_config "url.trash2/.pushInsteadOf" testrepo/ &&\n' span_id:737) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config "url.trash3/.pushInsteadOf" trash/wrong &&\n'
            span_id: 738
          ) (Token id:Id.Lit_Chars val:'\ttest_config remote.r.url trash/wrong &&\n' span_id:739) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config remote.r.pushurl "testrepo/" &&\n'
            span_id: 740
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push r refs/heads/master:refs/remotes/origin/master &&\n'
            span_id: 741
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:742) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:743) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "$the_commit commit\trefs/remotes/origin/master" >expect &&\n'
            span_id: 744
          ) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref refs/remotes/origin >actual &&\n' span_id:745) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:746) (Token id:Id.Lit_Chars val:'\t)\n' span_id:747)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'push with matching heads' span_id:754))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:758) (Token id:Id.Lit_Chars val:'\n' span_id:759) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:760) (Token id:Id.Lit_Chars val:'\tgit push testrepo : &&\n' span_id:761) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit heads/master\n'
            span_id: 762
          ) (Token id:Id.Lit_Chars val:'\n' span_id:763)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with matching heads on the command line' span_id:770))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:774) (Token id:Id.Lit_Chars val:'\n' span_id:775) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:776) (Token id:Id.Lit_Chars val:'\tgit push testrepo : &&\n' span_id:777) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit heads/master\n'
            span_id: 778
          ) (Token id:Id.Lit_Chars val:'\n' span_id:779)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'failed (non-fast-forward) push with matching heads'
            span_id: 786
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:790) (Token id:Id.Lit_Chars val:'\n' span_id:791) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:792) (Token id:Id.Lit_Chars val:'\tgit push testrepo : &&\n' span_id:793) 
          (Token id:Id.Lit_Chars val:'\tgit commit --amend -massaged &&\n' span_id:794) (Token id:Id.Lit_Chars val:'\ttest_must_fail git push testrepo &&\n' span_id:795) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit heads/master &&\n'
            span_id: 796
          ) (Token id:Id.Lit_Chars val:'\tgit reset --hard $the_commit\n' span_id:797) 
          (Token id:Id.Lit_Chars val:'\n' span_id:798)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push --force with matching heads' span_id:805))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:809) (Token id:Id.Lit_Chars val:'\n' span_id:810) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:811) (Token id:Id.Lit_Chars val:'\tgit push testrepo : &&\n' span_id:812) 
          (Token id:Id.Lit_Chars val:'\tgit commit --amend -massaged &&\n' span_id:813) (Token id:Id.Lit_Chars val:'\tgit push --force testrepo : &&\n' span_id:814) 
          (Token
            id: Id.Lit_Chars
            val: '\t! check_push_result testrepo $the_commit heads/master &&\n'
            span_id: 815
          ) (Token id:Id.Lit_Chars val:'\tgit reset --hard $the_commit\n' span_id:816) 
          (Token id:Id.Lit_Chars val:'\n' span_id:817)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with matching heads and forced update' span_id:824))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:828) (Token id:Id.Lit_Chars val:'\n' span_id:829) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:830) (Token id:Id.Lit_Chars val:'\tgit push testrepo : &&\n' span_id:831) 
          (Token id:Id.Lit_Chars val:'\tgit commit --amend -massaged &&\n' span_id:832) (Token id:Id.Lit_Chars val:'\tgit push testrepo +: &&\n' span_id:833) 
          (Token
            id: Id.Lit_Chars
            val: '\t! check_push_result testrepo $the_commit heads/master &&\n'
            span_id: 834
          ) (Token id:Id.Lit_Chars val:'\tgit reset --hard $the_commit\n' span_id:835) 
          (Token id:Id.Lit_Chars val:'\n' span_id:836)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with no ambiguity (1)' span_id:843))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:847) (Token id:Id.Lit_Chars val:'\n' span_id:848) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:849) (Token id:Id.Lit_Chars val:'\tgit push testrepo master:master &&\n' span_id:850) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit heads/master\n'
            span_id: 851
          ) (Token id:Id.Lit_Chars val:'\n' span_id:852)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with no ambiguity (2)' span_id:859))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:863) (Token id:Id.Lit_Chars val:'\n' span_id:864) 
          (Token
            id: Id.Lit_Chars
            val: '\tmk_test testrepo remotes/origin/master &&\n'
            span_id: 865
          ) (Token id:Id.Lit_Chars val:'\tgit push testrepo master:origin/master &&\n' span_id:866) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit remotes/origin/master\n'
            span_id: 867
          ) (Token id:Id.Lit_Chars val:'\n' span_id:868)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with colon-less refspec, no ambiguity' span_id:875))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:879) (Token id:Id.Lit_Chars val:'\n' span_id:880) 
          (Token
            id: Id.Lit_Chars
            val: '\tmk_test testrepo heads/master heads/t/master &&\n'
            span_id: 881
          ) (Token id:Id.Lit_Chars val:'\tgit branch -f t/master master &&\n' span_id:882) 
          (Token id:Id.Lit_Chars val:'\tgit push testrepo master &&\n' span_id:883) (Token id:Id.Lit_Chars val:'\tcheck_push_result testrepo $the_commit heads/master &&\n' span_id:884) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_first_commit heads/t/master\n'
            span_id: 885
          ) (Token id:Id.Lit_Chars val:'\n' span_id:886)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with weak ambiguity (1)' span_id:893))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:897) (Token id:Id.Lit_Chars val:'\n' span_id:898) 
          (Token
            id: Id.Lit_Chars
            val: '\tmk_test testrepo heads/master remotes/origin/master &&\n'
            span_id: 899
          ) (Token id:Id.Lit_Chars val:'\tgit push testrepo master:master &&\n' span_id:900) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit heads/master &&\n'
            span_id: 901
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_first_commit remotes/origin/master\n'
            span_id: 902
          ) (Token id:Id.Lit_Chars val:'\n' span_id:903)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with weak ambiguity (2)' span_id:910))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:914) (Token id:Id.Lit_Chars val:'\n' span_id:915) 
          (Token
            id: Id.Lit_Chars
            val: '\tmk_test testrepo heads/master remotes/origin/master remotes/another/master &&\n'
            span_id: 916
          ) (Token id:Id.Lit_Chars val:'\tgit push testrepo master:master &&\n' span_id:917) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit heads/master &&\n'
            span_id: 918
          ) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tcheck_push_result testrepo $the_first_commit remotes/origin/master remotes/another/master\n'
            span_id: 919
          ) (Token id:Id.Lit_Chars val:'\n' span_id:920)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'push with ambiguity' span_id:927))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:931) (Token id:Id.Lit_Chars val:'\n' span_id:932) 
          (Token
            id: Id.Lit_Chars
            val: '\tmk_test testrepo heads/frotz tags/frotz &&\n'
            span_id: 933
          ) (Token id:Id.Lit_Chars val:'\ttest_must_fail git push testrepo master:frotz &&\n' span_id:934) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_first_commit heads/frotz tags/frotz\n'
            span_id: 935
          ) (Token id:Id.Lit_Chars val:'\n' span_id:936)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with colon-less refspec (1)' span_id:943))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:947) (Token id:Id.Lit_Chars val:'\n' span_id:948) 
          (Token
            id: Id.Lit_Chars
            val: '\tmk_test testrepo heads/frotz tags/frotz &&\n'
            span_id: 949
          ) (Token id:Id.Lit_Chars val:'\tgit branch -f frotz master &&\n' span_id:950) 
          (Token id:Id.Lit_Chars val:'\tgit push testrepo frotz &&\n' span_id:951) (Token id:Id.Lit_Chars val:'\tcheck_push_result testrepo $the_commit heads/frotz &&\n' span_id:952) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_first_commit tags/frotz\n'
            span_id: 953
          ) (Token id:Id.Lit_Chars val:'\n' span_id:954)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with colon-less refspec (2)' span_id:961))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:965) (Token id:Id.Lit_Chars val:'\n' span_id:966) 
          (Token
            id: Id.Lit_Chars
            val: '\tmk_test testrepo heads/frotz tags/frotz &&\n'
            span_id: 967
          ) (Token id:Id.Lit_Chars val:'\tif git show-ref --verify -q refs/heads/frotz\n' span_id:968) 
          (Token id:Id.Lit_Chars val:'\tthen\n' span_id:969) (Token id:Id.Lit_Chars val:'\t\tgit branch -D frotz\n' span_id:970) 
          (Token id:Id.Lit_Chars val:'\tfi &&\n' span_id:971) (Token id:Id.Lit_Chars val:'\tgit tag -f frotz &&\n' span_id:972) 
          (Token id:Id.Lit_Chars val:'\tgit push -f testrepo frotz &&\n' span_id:973) (Token id:Id.Lit_Chars val:'\tcheck_push_result testrepo $the_commit tags/frotz &&\n' span_id:974) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_first_commit heads/frotz\n'
            span_id: 975
          ) (Token id:Id.Lit_Chars val:'\n' span_id:976)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with colon-less refspec (3)' span_id:983))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:987) (Token id:Id.Lit_Chars val:'\n' span_id:988) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo &&\n' span_id:989) (Token id:Id.Lit_Chars val:'\tif git show-ref --verify -q refs/tags/frotz\n' span_id:990) 
          (Token id:Id.Lit_Chars val:'\tthen\n' span_id:991) (Token id:Id.Lit_Chars val:'\t\tgit tag -d frotz\n' span_id:992) 
          (Token id:Id.Lit_Chars val:'\tfi &&\n' span_id:993) (Token id:Id.Lit_Chars val:'\tgit branch -f frotz master &&\n' span_id:994) 
          (Token id:Id.Lit_Chars val:'\tgit push testrepo frotz &&\n' span_id:995) (Token id:Id.Lit_Chars val:'\tcheck_push_result testrepo $the_commit heads/frotz &&\n' span_id:996) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest 1 = $( cd testrepo && git show-ref | wc -l )\n'
            span_id: 997
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with colon-less refspec (4)' span_id:1004))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1008) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1009) (Token id:Id.Lit_Chars val:'\tmk_test testrepo &&\n' span_id:1010) 
          (Token
            id: Id.Lit_Chars
            val: '\tif git show-ref --verify -q refs/heads/frotz\n'
            span_id: 1011
          ) (Token id:Id.Lit_Chars val:'\tthen\n' span_id:1012) 
          (Token id:Id.Lit_Chars val:'\t\tgit branch -D frotz\n' span_id:1013) (Token id:Id.Lit_Chars val:'\tfi &&\n' span_id:1014) 
          (Token id:Id.Lit_Chars val:'\tgit tag -f frotz &&\n' span_id:1015) (Token id:Id.Lit_Chars val:'\tgit push testrepo frotz &&\n' span_id:1016) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit tags/frotz &&\n'
            span_id: 1017
          ) (Token id:Id.Lit_Chars val:'\ttest 1 = $( cd testrepo && git show-ref | wc -l )\n' span_id:1018) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1019)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push head with non-existent, incomplete dest' span_id:1026))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1030) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1031) (Token id:Id.Lit_Chars val:'\tmk_test testrepo &&\n' span_id:1032) 
          (Token id:Id.Lit_Chars val:'\tgit push testrepo master:branch &&\n' span_id:1033) (Token id:Id.Lit_Chars val:'\tcheck_push_result testrepo $the_commit heads/branch\n' span_id:1034) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1035)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push tag with non-existent, incomplete dest' span_id:1042))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1046) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1047) (Token id:Id.Lit_Chars val:'\tmk_test testrepo &&\n' span_id:1048) 
          (Token id:Id.Lit_Chars val:'\tgit tag -f v1.0 &&\n' span_id:1049) (Token id:Id.Lit_Chars val:'\tgit push testrepo v1.0:tag &&\n' span_id:1050) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit tags/tag\n'
            span_id: 1051
          ) (Token id:Id.Lit_Chars val:'\n' span_id:1052)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push sha1 with non-existent, incomplete dest' span_id:1059))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1063) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1064) (Token id:Id.Lit_Chars val:'\tmk_test testrepo &&\n' span_id:1065) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git push testrepo $(git rev-parse master):foo\n'
            span_id: 1066
          ) (Token id:Id.Lit_Chars val:'\n' span_id:1067)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'push ref expression with non-existent, incomplete dest'
            span_id: 1074
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1078) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1079) (Token id:Id.Lit_Chars val:'\tmk_test testrepo &&\n' span_id:1080) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git push testrepo master^:branch\n'
            span_id: 1081
          ) (Token id:Id.Lit_Chars val:'\n' span_id:1082)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'push with HEAD' span_id:1089))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1093) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1094) (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1095) 
          (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:1096) (Token id:Id.Lit_Chars val:'\tgit push testrepo HEAD &&\n' span_id:1097) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit heads/master\n'
            span_id: 1098
          ) (Token id:Id.Lit_Chars val:'\n' span_id:1099)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with HEAD nonexisting at remote' span_id:1106))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1110) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1111) (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1112) 
          (Token id:Id.Lit_Chars val:'\tgit checkout -b local master &&\n' span_id:1113) (Token id:Id.Lit_Chars val:'\tgit push testrepo HEAD &&\n' span_id:1114) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit heads/local\n'
            span_id: 1115
          )
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'push with +HEAD' span_id:1122))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1126) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1127) (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1128) 
          (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:1129) (Token id:Id.Lit_Chars val:'\tgit branch -D local &&\n' span_id:1130) 
          (Token id:Id.Lit_Chars val:'\tgit checkout -b local &&\n' span_id:1131) (Token id:Id.Lit_Chars val:'\tgit push testrepo master local &&\n' span_id:1132) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit heads/master &&\n'
            span_id: 1133
          ) (Token id:Id.Lit_Chars val:'\tcheck_push_result testrepo $the_commit heads/local &&\n' span_id:1134) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1135) (Token id:Id.Lit_Chars val:'\t# Without force rewinding should fail\n' span_id:1136) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard HEAD^ &&\n' span_id:1137) (Token id:Id.Lit_Chars val:'\ttest_must_fail git push testrepo HEAD &&\n' span_id:1138) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit heads/local &&\n'
            span_id: 1139
          ) (Token id:Id.Lit_Chars val:'\n' span_id:1140) 
          (Token
            id: Id.Lit_Chars
            val: '\t# With force rewinding should succeed\n'
            span_id: 1141
          ) (Token id:Id.Lit_Chars val:'\tgit push testrepo +HEAD &&\n' span_id:1142) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_first_commit heads/local\n'
            span_id: 1143
          ) (Token id:Id.Lit_Chars val:'\n' span_id:1144)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push HEAD with non-existent, incomplete dest' span_id:1151))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1155) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1156) (Token id:Id.Lit_Chars val:'\tmk_test testrepo &&\n' span_id:1157) 
          (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:1158) (Token id:Id.Lit_Chars val:'\tgit push testrepo HEAD:branch &&\n' span_id:1159) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit heads/branch\n'
            span_id: 1160
          ) (Token id:Id.Lit_Chars val:'\n' span_id:1161)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with config remote.*.push = HEAD' span_id:1168))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1172) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1173) (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/local &&\n' span_id:1174) 
          (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:1175) (Token id:Id.Lit_Chars val:'\tgit branch -f local $the_commit &&\n' span_id:1176) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:1177) (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:1178) 
          (Token id:Id.Lit_Chars val:'\t\tgit checkout local &&\n' span_id:1179) (Token id:Id.Lit_Chars val:'\t\tgit reset --hard $the_first_commit\n' span_id:1180) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1181) (Token id:Id.Lit_Chars val:'\ttest_config remote.there.url testrepo &&\n' span_id:1182) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config remote.there.push HEAD &&\n'
            span_id: 1183
          ) (Token id:Id.Lit_Chars val:'\ttest_config branch.master.remote there &&\n' span_id:1184) 
          (Token id:Id.Lit_Chars val:'\tgit push &&\n' span_id:1185) (Token id:Id.Lit_Chars val:'\tcheck_push_result testrepo $the_commit heads/master &&\n' span_id:1186) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_first_commit heads/local\n'
            span_id: 1187
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with remote.pushdefault' span_id:1194))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1198) 
          (Token id:Id.Lit_Chars val:'\tmk_test up_repo heads/master &&\n' span_id:1199) (Token id:Id.Lit_Chars val:'\tmk_test down_repo heads/master &&\n' span_id:1200) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config remote.up.url up_repo &&\n'
            span_id: 1201
          ) (Token id:Id.Lit_Chars val:'\ttest_config remote.down.url down_repo &&\n' span_id:1202) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config branch.master.remote up &&\n'
            span_id: 1203
          ) (Token id:Id.Lit_Chars val:'\ttest_config remote.pushdefault down &&\n' span_id:1204) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config push.default matching &&\n'
            span_id: 1205
          ) (Token id:Id.Lit_Chars val:'\tgit push &&\n' span_id:1206) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result up_repo $the_first_commit heads/master &&\n'
            span_id: 1207
          ) (Token id:Id.Lit_Chars val:'\tcheck_push_result down_repo $the_commit heads/master\n' span_id:1208)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with config remote.*.pushurl' span_id:1215))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1219) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1220) (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1221) 
          (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:1222) (Token id:Id.Lit_Chars val:'\ttest_config remote.there.url test2repo &&\n' span_id:1223) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config remote.there.pushurl testrepo &&\n'
            span_id: 1224
          ) (Token id:Id.Lit_Chars val:'\tgit push there : &&\n' span_id:1225) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit heads/master\n'
            span_id: 1226
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with config branch.*.pushremote' span_id:1233))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1237) 
          (Token id:Id.Lit_Chars val:'\tmk_test up_repo heads/master &&\n' span_id:1238) (Token id:Id.Lit_Chars val:'\tmk_test side_repo heads/master &&\n' span_id:1239) 
          (Token id:Id.Lit_Chars val:'\tmk_test down_repo heads/master &&\n' span_id:1240) (Token id:Id.Lit_Chars val:'\ttest_config remote.up.url up_repo &&\n' span_id:1241) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config remote.pushdefault side_repo &&\n'
            span_id: 1242
          ) (Token id:Id.Lit_Chars val:'\ttest_config remote.down.url down_repo &&\n' span_id:1243) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config branch.master.remote up &&\n'
            span_id: 1244
          ) (Token id:Id.Lit_Chars val:'\ttest_config branch.master.pushremote down &&\n' span_id:1245) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config push.default matching &&\n'
            span_id: 1246
          ) (Token id:Id.Lit_Chars val:'\tgit push &&\n' span_id:1247) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result up_repo $the_first_commit heads/master &&\n'
            span_id: 1248
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result side_repo $the_first_commit heads/master &&\n'
            span_id: 1249
          ) (Token id:Id.Lit_Chars val:'\tcheck_push_result down_repo $the_commit heads/master\n' span_id:1250)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'branch.*.pushremote config order is irrelevant' span_id:1257))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1261) 
          (Token id:Id.Lit_Chars val:'\tmk_test one_repo heads/master &&\n' span_id:1262) (Token id:Id.Lit_Chars val:'\tmk_test two_repo heads/master &&\n' span_id:1263) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config remote.one.url one_repo &&\n'
            span_id: 1264
          ) (Token id:Id.Lit_Chars val:'\ttest_config remote.two.url two_repo &&\n' span_id:1265) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config branch.master.pushremote two_repo &&\n'
            span_id: 1266
          ) (Token id:Id.Lit_Chars val:'\ttest_config remote.pushdefault one_repo &&\n' span_id:1267) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config push.default matching &&\n'
            span_id: 1268
          ) (Token id:Id.Lit_Chars val:'\tgit push &&\n' span_id:1269) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result one_repo $the_first_commit heads/master &&\n'
            span_id: 1270
          ) (Token id:Id.Lit_Chars val:'\tcheck_push_result two_repo $the_commit heads/master\n' span_id:1271)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'push with dry-run' span_id:1278))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1282) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1283) (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1284) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:1285) (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:1286) 
          (Token
            id: Id.Lit_Chars
            val: '\t\told_commit=$(git show-ref -s --verify refs/heads/master)\n'
            span_id: 1287
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1288) 
          (Token id:Id.Lit_Chars val:'\tgit push --dry-run testrepo : &&\n' span_id:1289) (Token id:Id.Lit_Chars val:'\tcheck_push_result testrepo $old_commit heads/master\n' span_id:1290)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'push updates local refs' span_id:1297))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1301) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1302) (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1303) 
          (Token id:Id.Lit_Chars val:'\tmk_child testrepo child &&\n' span_id:1304) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1305) 
          (Token id:Id.Lit_Chars val:'\t\tcd child &&\n' span_id:1306) (Token id:Id.Lit_Chars val:'\t\tgit pull .. master &&\n' span_id:1307) 
          (Token id:Id.Lit_Chars val:'\t\tgit push &&\n' span_id:1308) (Token id:Id.Lit_Chars val:'\t\ttest $(git rev-parse master) = \\\n' span_id:1309) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t\t$(git rev-parse remotes/origin/master)\n'
            span_id: 1310
          ) (Token id:Id.Lit_Chars val:'\t)\n' span_id:1311) (Token id:Id.Lit_Chars val:'\n' span_id:1312)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push updates up-to-date local refs' span_id:1319))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1323) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1324) (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1325) 
          (Token id:Id.Lit_Chars val:'\tmk_child testrepo child1 &&\n' span_id:1326) (Token id:Id.Lit_Chars val:'\tmk_child testrepo child2 &&\n' span_id:1327) 
          (Token
            id: Id.Lit_Chars
            val: '\t(cd child1 && git pull .. master && git push) &&\n'
            span_id: 1328
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1329) 
          (Token id:Id.Lit_Chars val:'\t\tcd child2 &&\n' span_id:1330) (Token id:Id.Lit_Chars val:'\t\tgit pull ../child1 master &&\n' span_id:1331) 
          (Token id:Id.Lit_Chars val:'\t\tgit push &&\n' span_id:1332) (Token id:Id.Lit_Chars val:'\t\ttest $(git rev-parse master) = \\\n' span_id:1333) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t\t$(git rev-parse remotes/origin/master)\n'
            span_id: 1334
          ) (Token id:Id.Lit_Chars val:'\t)\n' span_id:1335) (Token id:Id.Lit_Chars val:'\n' span_id:1336)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push preserves up-to-date packed refs' span_id:1343))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1347) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1348) (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1349) 
          (Token id:Id.Lit_Chars val:'\tmk_child testrepo child &&\n' span_id:1350) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1351) 
          (Token id:Id.Lit_Chars val:'\t\tcd child &&\n' span_id:1352) (Token id:Id.Lit_Chars val:'\t\tgit push &&\n' span_id:1353) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t! test -f .git/refs/remotes/origin/master\n'
            span_id: 1354
          ) (Token id:Id.Lit_Chars val:'\t)\n' span_id:1355) (Token id:Id.Lit_Chars val:'\n' span_id:1356)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push does not update local refs on failure' span_id:1363))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1367) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1368) (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1369) 
          (Token id:Id.Lit_Chars val:'\tmk_child testrepo child &&\n' span_id:1370) (Token id:Id.Lit_Chars val:'\tmkdir testrepo/.git/hooks &&\n' span_id:1371) 
          (Token
            id: Id.Lit_Chars
            val: '\techo "#!/no/frobnication/today" >testrepo/.git/hooks/pre-receive &&\n'
            span_id: 1372
          ) (Token id:Id.Lit_Chars val:'\tchmod +x testrepo/.git/hooks/pre-receive &&\n' span_id:1373) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:1374) (Token id:Id.Lit_Chars val:'\t\tcd child &&\n' span_id:1375) 
          (Token id:Id.Lit_Chars val:'\t\tgit pull .. master\n' span_id:1376) (Token id:Id.Lit_Chars val:'\t\ttest_must_fail git push &&\n' span_id:1377) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest $(git rev-parse master) != \\\n'
            span_id: 1378
          ) (Token id:Id.Lit_Chars val:'\t\t\t$(git rev-parse remotes/origin/master)\n' span_id:1379) 
          (Token id:Id.Lit_Chars val:'\t)\n' span_id:1380) (Token id:Id.Lit_Chars val:'\n' span_id:1381)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'allow deleting an invalid remote ref' span_id:1388))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1392) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1393) (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1394) 
          (Token
            id: Id.Lit_Chars
            val: '\trm -f testrepo/.git/objects/??/* &&\n'
            span_id: 1395
          ) (Token id:Id.Lit_Chars val:'\tgit push testrepo :refs/heads/master &&\n' span_id:1396) 
          (Token
            id: Id.Lit_Chars
            val: '\t(cd testrepo && test_must_fail git rev-parse --verify refs/heads/master)\n'
            span_id: 1397
          ) (Token id:Id.Lit_Chars val:'\n' span_id:1398)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'pushing valid refs triggers post-receive and post-update hooks'
            span_id: 1405
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1409) 
          (Token
            id: Id.Lit_Chars
            val: '\tmk_test_with_hooks testrepo heads/master heads/next &&\n'
            span_id: 1410
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\torgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&\n'
            span_id: 1411
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tnewmaster=$(git show-ref -s --verify refs/heads/master) &&\n'
            span_id: 1412
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\torgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) &&\n'
            span_id: 1413
          ) (Token id:Id.Lit_Chars val:'\tnewnext=$_z40 &&\n' span_id:1414) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push testrepo refs/heads/master:refs/heads/master :refs/heads/next &&\n'
            span_id: 1415
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1416) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo/.git &&\n' span_id:1417) (Token id:Id.Lit_Chars val:'\t\tcat >pre-receive.expect <<-EOF &&\n' span_id:1418) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t$orgmaster $newmaster refs/heads/master\n'
            span_id: 1419
          ) (Token id:Id.Lit_Chars val:'\t\t$orgnext $newnext refs/heads/next\n' span_id:1420) 
          (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1421) (Token id:Id.Lit_Chars val:'\n' span_id:1422) 
          (Token id:Id.Lit_Chars val:'\t\tcat >update.expect <<-EOF &&\n' span_id:1423) (Token id:Id.Lit_Chars val:'\t\trefs/heads/master $orgmaster $newmaster\n' span_id:1424) 
          (Token
            id: Id.Lit_Chars
            val: '\t\trefs/heads/next $orgnext $newnext\n'
            span_id: 1425
          ) (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1426) (Token id:Id.Lit_Chars val:'\n' span_id:1427) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tcat >post-receive.expect <<-EOF &&\n'
            span_id: 1428
          ) (Token id:Id.Lit_Chars val:'\t\t$orgmaster $newmaster refs/heads/master\n' span_id:1429) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t$orgnext $newnext refs/heads/next\n'
            span_id: 1430
          ) (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1431) (Token id:Id.Lit_Chars val:'\n' span_id:1432) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tcat >post-update.expect <<-EOF &&\n'
            span_id: 1433
          ) (Token id:Id.Lit_Chars val:'\t\trefs/heads/master\n' span_id:1434) 
          (Token id:Id.Lit_Chars val:'\t\trefs/heads/next\n' span_id:1435) (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1436) (Token id:Id.Lit_Chars val:'\n' span_id:1437) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_cmp pre-receive.expect pre-receive.actual &&\n'
            span_id: 1438
          ) (Token id:Id.Lit_Chars val:'\t\ttest_cmp update.expect update.actual &&\n' span_id:1439) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_cmp post-receive.expect post-receive.actual &&\n'
            span_id: 1440
          ) (Token id:Id.Lit_Chars val:'\t\ttest_cmp post-update.expect post-update.actual\n' span_id:1441) 
          (Token id:Id.Lit_Chars val:'\t)\n' span_id:1442)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'deleting dangling ref triggers hooks with correct args'
            span_id: 1449
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1453) 
          (Token
            id: Id.Lit_Chars
            val: '\tmk_test_with_hooks testrepo heads/master &&\n'
            span_id: 1454
          ) (Token id:Id.Lit_Chars val:'\trm -f testrepo/.git/objects/??/* &&\n' span_id:1455) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push testrepo :refs/heads/master &&\n'
            span_id: 1456
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1457) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo/.git &&\n' span_id:1458) (Token id:Id.Lit_Chars val:'\t\tcat >pre-receive.expect <<-EOF &&\n' span_id:1459) 
          (Token id:Id.Lit_Chars val:'\t\t$_z40 $_z40 refs/heads/master\n' span_id:1460) (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1461) (Token id:Id.Lit_Chars val:'\n' span_id:1462) 
          (Token id:Id.Lit_Chars val:'\t\tcat >update.expect <<-EOF &&\n' span_id:1463) (Token id:Id.Lit_Chars val:'\t\trefs/heads/master $_z40 $_z40\n' span_id:1464) 
          (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1465) (Token id:Id.Lit_Chars val:'\n' span_id:1466) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tcat >post-receive.expect <<-EOF &&\n'
            span_id: 1467
          ) (Token id:Id.Lit_Chars val:'\t\t$_z40 $_z40 refs/heads/master\n' span_id:1468) 
          (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1469) (Token id:Id.Lit_Chars val:'\n' span_id:1470) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tcat >post-update.expect <<-EOF &&\n'
            span_id: 1471
          ) (Token id:Id.Lit_Chars val:'\t\trefs/heads/master\n' span_id:1472) 
          (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1473) (Token id:Id.Lit_Chars val:'\n' span_id:1474) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_cmp pre-receive.expect pre-receive.actual &&\n'
            span_id: 1475
          ) (Token id:Id.Lit_Chars val:'\t\ttest_cmp update.expect update.actual &&\n' span_id:1476) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_cmp post-receive.expect post-receive.actual &&\n'
            span_id: 1477
          ) (Token id:Id.Lit_Chars val:'\t\ttest_cmp post-update.expect post-update.actual\n' span_id:1478) 
          (Token id:Id.Lit_Chars val:'\t)\n' span_id:1479)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'deletion of a non-existent ref is not fed to post-receive and post-update hooks'
            span_id: 1486
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1490) 
          (Token
            id: Id.Lit_Chars
            val: '\tmk_test_with_hooks testrepo heads/master &&\n'
            span_id: 1491
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\torgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&\n'
            span_id: 1492
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tnewmaster=$(git show-ref -s --verify refs/heads/master) &&\n'
            span_id: 1493
          ) (Token id:Id.Lit_Chars val:'\tgit push testrepo master :refs/heads/nonexistent &&\n' span_id:1494) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:1495) (Token id:Id.Lit_Chars val:'\t\tcd testrepo/.git &&\n' span_id:1496) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tcat >pre-receive.expect <<-EOF &&\n'
            span_id: 1497
          ) (Token id:Id.Lit_Chars val:'\t\t$orgmaster $newmaster refs/heads/master\n' span_id:1498) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t$_z40 $_z40 refs/heads/nonexistent\n'
            span_id: 1499
          ) (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1500) (Token id:Id.Lit_Chars val:'\n' span_id:1501) 
          (Token id:Id.Lit_Chars val:'\t\tcat >update.expect <<-EOF &&\n' span_id:1502) (Token id:Id.Lit_Chars val:'\t\trefs/heads/master $orgmaster $newmaster\n' span_id:1503) 
          (Token
            id: Id.Lit_Chars
            val: '\t\trefs/heads/nonexistent $_z40 $_z40\n'
            span_id: 1504
          ) (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1505) (Token id:Id.Lit_Chars val:'\n' span_id:1506) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tcat >post-receive.expect <<-EOF &&\n'
            span_id: 1507
          ) (Token id:Id.Lit_Chars val:'\t\t$orgmaster $newmaster refs/heads/master\n' span_id:1508) 
          (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1509) (Token id:Id.Lit_Chars val:'\n' span_id:1510) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tcat >post-update.expect <<-EOF &&\n'
            span_id: 1511
          ) (Token id:Id.Lit_Chars val:'\t\trefs/heads/master\n' span_id:1512) 
          (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1513) (Token id:Id.Lit_Chars val:'\n' span_id:1514) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_cmp pre-receive.expect pre-receive.actual &&\n'
            span_id: 1515
          ) (Token id:Id.Lit_Chars val:'\t\ttest_cmp update.expect update.actual &&\n' span_id:1516) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_cmp post-receive.expect post-receive.actual &&\n'
            span_id: 1517
          ) (Token id:Id.Lit_Chars val:'\t\ttest_cmp post-update.expect post-update.actual\n' span_id:1518) 
          (Token id:Id.Lit_Chars val:'\t)\n' span_id:1519)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 
'deletion of a non-existent ref alone does trigger post-receive and post-update hooks'
            span_id: 1526
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1530) 
          (Token
            id: Id.Lit_Chars
            val: '\tmk_test_with_hooks testrepo heads/master &&\n'
            span_id: 1531
          ) (Token id:Id.Lit_Chars val:'\tgit push testrepo :refs/heads/nonexistent &&\n' span_id:1532) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:1533) (Token id:Id.Lit_Chars val:'\t\tcd testrepo/.git &&\n' span_id:1534) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tcat >pre-receive.expect <<-EOF &&\n'
            span_id: 1535
          ) (Token id:Id.Lit_Chars val:'\t\t$_z40 $_z40 refs/heads/nonexistent\n' span_id:1536) 
          (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1537) (Token id:Id.Lit_Chars val:'\n' span_id:1538) 
          (Token id:Id.Lit_Chars val:'\t\tcat >update.expect <<-EOF &&\n' span_id:1539) (Token id:Id.Lit_Chars val:'\t\trefs/heads/nonexistent $_z40 $_z40\n' span_id:1540) 
          (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1541) (Token id:Id.Lit_Chars val:'\n' span_id:1542) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_cmp pre-receive.expect pre-receive.actual &&\n'
            span_id: 1543
          ) (Token id:Id.Lit_Chars val:'\t\ttest_cmp update.expect update.actual &&\n' span_id:1544) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_path_is_missing post-receive.actual &&\n'
            span_id: 1545
          ) (Token id:Id.Lit_Chars val:'\t\ttest_path_is_missing post-update.actual\n' span_id:1546) 
          (Token id:Id.Lit_Chars val:'\t)\n' span_id:1547)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'mixed ref updates, deletes, invalid deletes trigger hooks with correct input'
            span_id: 1554
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1558) 
          (Token
            id: Id.Lit_Chars
            val: '\tmk_test_with_hooks testrepo heads/master heads/next heads/pu &&\n'
            span_id: 1559
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\torgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&\n'
            span_id: 1560
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tnewmaster=$(git show-ref -s --verify refs/heads/master) &&\n'
            span_id: 1561
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\torgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) &&\n'
            span_id: 1562
          ) (Token id:Id.Lit_Chars val:'\tnewnext=$_z40 &&\n' span_id:1563) 
          (Token
            id: Id.Lit_Chars
            val: '\torgpu=$(cd testrepo && git show-ref -s --verify refs/heads/pu) &&\n'
            span_id: 1564
          ) (Token id:Id.Lit_Chars val:'\tnewpu=$(git show-ref -s --verify refs/heads/master) &&\n' span_id:1565) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push testrepo refs/heads/master:refs/heads/master \\\n'
            span_id: 1566
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t    refs/heads/master:refs/heads/pu :refs/heads/next \\\n'
            span_id: 1567
          ) (Token id:Id.Lit_Chars val:'\t    :refs/heads/nonexistent &&\n' span_id:1568) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:1569) (Token id:Id.Lit_Chars val:'\t\tcd testrepo/.git &&\n' span_id:1570) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tcat >pre-receive.expect <<-EOF &&\n'
            span_id: 1571
          ) (Token id:Id.Lit_Chars val:'\t\t$orgmaster $newmaster refs/heads/master\n' span_id:1572) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t$orgnext $newnext refs/heads/next\n'
            span_id: 1573
          ) (Token id:Id.Lit_Chars val:'\t\t$orgpu $newpu refs/heads/pu\n' span_id:1574) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t$_z40 $_z40 refs/heads/nonexistent\n'
            span_id: 1575
          ) (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1576) (Token id:Id.Lit_Chars val:'\n' span_id:1577) 
          (Token id:Id.Lit_Chars val:'\t\tcat >update.expect <<-EOF &&\n' span_id:1578) (Token id:Id.Lit_Chars val:'\t\trefs/heads/master $orgmaster $newmaster\n' span_id:1579) 
          (Token
            id: Id.Lit_Chars
            val: '\t\trefs/heads/next $orgnext $newnext\n'
            span_id: 1580
          ) (Token id:Id.Lit_Chars val:'\t\trefs/heads/pu $orgpu $newpu\n' span_id:1581) 
          (Token
            id: Id.Lit_Chars
            val: '\t\trefs/heads/nonexistent $_z40 $_z40\n'
            span_id: 1582
          ) (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1583) (Token id:Id.Lit_Chars val:'\n' span_id:1584) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tcat >post-receive.expect <<-EOF &&\n'
            span_id: 1585
          ) (Token id:Id.Lit_Chars val:'\t\t$orgmaster $newmaster refs/heads/master\n' span_id:1586) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t$orgnext $newnext refs/heads/next\n'
            span_id: 1587
          ) (Token id:Id.Lit_Chars val:'\t\t$orgpu $newpu refs/heads/pu\n' span_id:1588) 
          (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1589) (Token id:Id.Lit_Chars val:'\n' span_id:1590) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tcat >post-update.expect <<-EOF &&\n'
            span_id: 1591
          ) (Token id:Id.Lit_Chars val:'\t\trefs/heads/master\n' span_id:1592) 
          (Token id:Id.Lit_Chars val:'\t\trefs/heads/next\n' span_id:1593) (Token id:Id.Lit_Chars val:'\t\trefs/heads/pu\n' span_id:1594) 
          (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:1595) (Token id:Id.Lit_Chars val:'\n' span_id:1596) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_cmp pre-receive.expect pre-receive.actual &&\n'
            span_id: 1597
          ) (Token id:Id.Lit_Chars val:'\t\ttest_cmp update.expect update.actual &&\n' span_id:1598) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_cmp post-receive.expect post-receive.actual &&\n'
            span_id: 1599
          ) (Token id:Id.Lit_Chars val:'\t\ttest_cmp post-update.expect post-update.actual\n' span_id:1600) 
          (Token id:Id.Lit_Chars val:'\t)\n' span_id:1601)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'allow deleting a ref using --delete' span_id:1608))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1612) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1613) 
          (Token
            id: Id.Lit_Chars
            val: '\t(cd testrepo && git config receive.denyDeleteCurrent warn) &&\n'
            span_id: 1614
          ) (Token id:Id.Lit_Chars val:'\tgit push testrepo --delete master &&\n' span_id:1615) 
          (Token
            id: Id.Lit_Chars
            val: '\t(cd testrepo && test_must_fail git rev-parse --verify refs/heads/master)\n'
            span_id: 1616
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'allow deleting a tag using --delete' span_id:1623))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1627) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1628) (Token id:Id.Lit_Chars val:'\tgit tag -a -m dummy_message deltag heads/master &&\n' span_id:1629) 
          (Token id:Id.Lit_Chars val:'\tgit push testrepo --tags &&\n' span_id:1630) 
          (Token
            id: Id.Lit_Chars
            val: '\t(cd testrepo && git rev-parse --verify -q refs/tags/deltag) &&\n'
            span_id: 1631
          ) (Token id:Id.Lit_Chars val:'\tgit push testrepo --delete tag deltag &&\n' span_id:1632) 
          (Token
            id: Id.Lit_Chars
            val: '\t(cd testrepo && test_must_fail git rev-parse --verify refs/tags/deltag)\n'
            span_id: 1633
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push --delete without args aborts' span_id:1640))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1644) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1645) (Token id:Id.Lit_Chars val:'\ttest_must_fail git push testrepo --delete\n' span_id:1646)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push --delete refuses src:dest refspecs' span_id:1653))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1657) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1658) (Token id:Id.Lit_Chars val:'\ttest_must_fail git push testrepo --delete master:foo\n' span_id:1659)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'warn on push to HEAD of non-bare repository' span_id:1666))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1670) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1671) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1672) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:1673) (Token id:Id.Lit_Chars val:'\t\tgit checkout master &&\n' span_id:1674) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config receive.denyCurrentBranch warn\n'
            span_id: 1675
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1676) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push testrepo master 2>stderr &&\n'
            span_id: 1677
          ) (Token id:Id.Lit_Chars val:'\tgrep "warning: updating the current branch" stderr\n' span_id:1678)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'deny push to HEAD of non-bare repository' span_id:1685))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1689) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1690) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1691) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:1692) (Token id:Id.Lit_Chars val:'\t\tgit checkout master &&\n' span_id:1693) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config receive.denyCurrentBranch true\n'
            span_id: 1694
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1695) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git push testrepo master\n'
            span_id: 1696
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'allow push to HEAD of bare repository (bare)' span_id:1703))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1707) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1708) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1709) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:1710) (Token id:Id.Lit_Chars val:'\t\tgit checkout master &&\n' span_id:1711) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config receive.denyCurrentBranch true &&\n'
            span_id: 1712
          ) (Token id:Id.Lit_Chars val:'\t\tgit config core.bare true\n' span_id:1713) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1714) (Token id:Id.Lit_Chars val:'\tgit push testrepo master 2>stderr &&\n' span_id:1715) 
          (Token
            id: Id.Lit_Chars
            val: '\t! grep "warning: updating the current branch" stderr\n'
            span_id: 1716
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'allow push to HEAD of non-bare repository (config)'
            span_id: 1723
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1727) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1728) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1729) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:1730) (Token id:Id.Lit_Chars val:'\t\tgit checkout master &&\n' span_id:1731) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config receive.denyCurrentBranch false\n'
            span_id: 1732
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1733) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push testrepo master 2>stderr &&\n'
            span_id: 1734
          ) (Token id:Id.Lit_Chars val:'\t! grep "warning: updating the current branch" stderr\n' span_id:1735)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch with branches' span_id:1742))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1746) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:1747) (Token id:Id.Lit_Chars val:'\tgit branch second $the_first_commit &&\n' span_id:1748) 
          (Token id:Id.Lit_Chars val:'\tgit checkout second &&\n' span_id:1749) (Token id:Id.Lit_Chars val:'\techo ".." > testrepo/.git/branches/branch1 &&\n' span_id:1750) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:1751) (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:1752) 
          (Token id:Id.Lit_Chars val:'\t\tgit fetch branch1 &&\n' span_id:1753) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "$the_commit commit\trefs/heads/branch1" >expect &&\n'
            span_id: 1754
          ) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref refs/heads >actual &&\n' span_id:1755) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:1756) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1757) 
          (Token id:Id.Lit_Chars val:'\tgit checkout master\n' span_id:1758)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'fetch with branches containing #' span_id:1765))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1769) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:1770) (Token id:Id.Lit_Chars val:'\techo "..#second" > testrepo/.git/branches/branch2 &&\n' span_id:1771) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:1772) (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:1773) 
          (Token id:Id.Lit_Chars val:'\t\tgit fetch branch2 &&\n' span_id:1774) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "$the_first_commit commit\trefs/heads/branch2" >expect &&\n'
            span_id: 1775
          ) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref refs/heads >actual &&\n' span_id:1776) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:1777) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1778) 
          (Token id:Id.Lit_Chars val:'\tgit checkout master\n' span_id:1779)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'push with branches' span_id:1786))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1790) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:1791) (Token id:Id.Lit_Chars val:'\tgit checkout second &&\n' span_id:1792) 
          (Token
            id: Id.Lit_Chars
            val: '\techo "testrepo" > .git/branches/branch1 &&\n'
            span_id: 1793
          ) (Token id:Id.Lit_Chars val:'\tgit push branch1 &&\n' span_id:1794) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:1795) (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:1796) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "$the_first_commit commit\trefs/heads/master" >expect &&\n'
            span_id: 1797
          ) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref refs/heads >actual &&\n' span_id:1798) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:1799) (Token id:Id.Lit_Chars val:'\t)\n' span_id:1800)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push with branches containing #' span_id:1807))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1811) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:1812) (Token id:Id.Lit_Chars val:'\techo "testrepo#branch3" > .git/branches/branch2 &&\n' span_id:1813) 
          (Token id:Id.Lit_Chars val:'\tgit push branch2 &&\n' span_id:1814) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1815) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:1816) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "$the_first_commit commit\trefs/heads/branch3" >expect &&\n'
            span_id: 1817
          ) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref refs/heads >actual &&\n' span_id:1818) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:1819) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1820) 
          (Token id:Id.Lit_Chars val:'\tgit checkout master\n' span_id:1821)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push into aliased refs (consistent)' span_id:1828))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1832) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1833) (Token id:Id.Lit_Chars val:'\tmk_child testrepo child1 &&\n' span_id:1834) 
          (Token id:Id.Lit_Chars val:'\tmk_child testrepo child2 &&\n' span_id:1835) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1836) 
          (Token id:Id.Lit_Chars val:'\t\tcd child1 &&\n' span_id:1837) (Token id:Id.Lit_Chars val:'\t\tgit branch foo &&\n' span_id:1838) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit symbolic-ref refs/heads/bar refs/heads/foo\n'
            span_id: 1839
          ) (Token id:Id.Lit_Chars val:'\t\tgit config receive.denyCurrentBranch false\n' span_id:1840) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1841) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1842) 
          (Token id:Id.Lit_Chars val:'\t\tcd child2 &&\n' span_id:1843) (Token id:Id.Lit_Chars val:'\t\t>path2 &&\n' span_id:1844) 
          (Token id:Id.Lit_Chars val:'\t\tgit add path2 &&\n' span_id:1845) (Token id:Id.Lit_Chars val:'\t\ttest_tick &&\n' span_id:1846) 
          (Token id:Id.Lit_Chars val:'\t\tgit commit -a -m child2 &&\n' span_id:1847) (Token id:Id.Lit_Chars val:'\t\tgit branch foo &&\n' span_id:1848) 
          (Token id:Id.Lit_Chars val:'\t\tgit branch bar &&\n' span_id:1849) (Token id:Id.Lit_Chars val:'\t\tgit push ../child1 foo bar\n' span_id:1850) 
          (Token id:Id.Lit_Chars val:'\t)\n' span_id:1851)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push into aliased refs (inconsistent)' span_id:1858))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1862) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1863) (Token id:Id.Lit_Chars val:'\tmk_child testrepo child1 &&\n' span_id:1864) 
          (Token id:Id.Lit_Chars val:'\tmk_child testrepo child2 &&\n' span_id:1865) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1866) 
          (Token id:Id.Lit_Chars val:'\t\tcd child1 &&\n' span_id:1867) (Token id:Id.Lit_Chars val:'\t\tgit branch foo &&\n' span_id:1868) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit symbolic-ref refs/heads/bar refs/heads/foo\n'
            span_id: 1869
          ) (Token id:Id.Lit_Chars val:'\t\tgit config receive.denyCurrentBranch false\n' span_id:1870) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1871) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1872) 
          (Token id:Id.Lit_Chars val:'\t\tcd child2 &&\n' span_id:1873) (Token id:Id.Lit_Chars val:'\t\t>path2 &&\n' span_id:1874) 
          (Token id:Id.Lit_Chars val:'\t\tgit add path2 &&\n' span_id:1875) (Token id:Id.Lit_Chars val:'\t\ttest_tick &&\n' span_id:1876) 
          (Token id:Id.Lit_Chars val:'\t\tgit commit -a -m child2 &&\n' span_id:1877) (Token id:Id.Lit_Chars val:'\t\tgit branch foo &&\n' span_id:1878) 
          (Token id:Id.Lit_Chars val:'\t\t>path3 &&\n' span_id:1879) (Token id:Id.Lit_Chars val:'\t\tgit add path3 &&\n' span_id:1880) 
          (Token id:Id.Lit_Chars val:'\t\ttest_tick &&\n' span_id:1881) (Token id:Id.Lit_Chars val:'\t\tgit commit -a -m child2 &&\n' span_id:1882) 
          (Token id:Id.Lit_Chars val:'\t\tgit branch bar &&\n' span_id:1883) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_must_fail git push ../child1 foo bar 2>stderr &&\n'
            span_id: 1884
          ) (Token id:Id.Lit_Chars val:'\t\tgrep "refusing inconsistent update" stderr\n' span_id:1885) 
          (Token id:Id.Lit_Chars val:'\t)\n' span_id:1886)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'push requires --force to update lightweight tag'
            span_id: 1893
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1897) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:1898) (Token id:Id.Lit_Chars val:'\tmk_child testrepo child1 &&\n' span_id:1899) 
          (Token id:Id.Lit_Chars val:'\tmk_child testrepo child2 &&\n' span_id:1900) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1901) 
          (Token id:Id.Lit_Chars val:'\t\tcd child1 &&\n' span_id:1902) (Token id:Id.Lit_Chars val:'\t\tgit tag Tag &&\n' span_id:1903) 
          (Token id:Id.Lit_Chars val:'\t\tgit push ../child2 Tag &&\n' span_id:1904) (Token id:Id.Lit_Chars val:'\t\tgit push ../child2 Tag &&\n' span_id:1905) 
          (Token id:Id.Lit_Chars val:'\t\t>file1 &&\n' span_id:1906) (Token id:Id.Lit_Chars val:'\t\tgit add file1 &&\n' span_id:1907) 
          (Token id:Id.Lit_Chars val:'\t\tgit commit -m "file1" &&\n' span_id:1908) (Token id:Id.Lit_Chars val:'\t\tgit tag -f Tag &&\n' span_id:1909) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_must_fail git push ../child2 Tag &&\n'
            span_id: 1910
          ) (Token id:Id.Lit_Chars val:'\t\tgit push --force ../child2 Tag &&\n' span_id:1911) 
          (Token id:Id.Lit_Chars val:'\t\tgit tag -f Tag &&\n' span_id:1912) (Token id:Id.Lit_Chars val:'\t\ttest_must_fail git push ../child2 Tag HEAD~ &&\n' span_id:1913) 
          (Token id:Id.Lit_Chars val:'\t\tgit push --force ../child2 Tag\n' span_id:1914) (Token id:Id.Lit_Chars val:'\t)\n' span_id:1915)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'push --porcelain' span_id:1922))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1926) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:1927) (Token id:Id.Lit_Chars val:'\techo >.git/foo  "To testrepo" &&\n' span_id:1928) 
          (Token
            id: Id.Lit_Chars
            val: 
'\techo >>.git/foo "*\trefs/heads/master:refs/remotes/origin/master\t[new branch]"  &&\n'
            span_id: 1929
          ) (Token id:Id.Lit_Chars val:'\techo >>.git/foo "Done" &&\n' span_id:1930) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tgit push >.git/bar --porcelain  testrepo refs/heads/master:refs/remotes/origin/master &&\n'
            span_id: 1931
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1932) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:1933) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "$the_commit commit\trefs/remotes/origin/master" >expect &&\n'
            span_id: 1934
          ) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref refs/remotes/origin >actual &&\n' span_id:1935) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:1936) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1937) 
          (Token id:Id.Lit_Chars val:'\ttest_cmp .git/foo .git/bar\n' span_id:1938)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push --porcelain bad url' span_id:1945))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1949) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:1950) 
          (Token
            id: Id.Lit_Chars
            val: 
'\ttest_must_fail git push >.git/bar --porcelain asdfasdfasd refs/heads/master:refs/remotes/origin/master &&\n'
            span_id: 1951
          ) (Token id:Id.Lit_Chars val:'\ttest_must_fail grep -q Done .git/bar\n' span_id:1952)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push --porcelain rejected' span_id:1959))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1963) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:1964) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push testrepo refs/heads/master:refs/remotes/origin/master &&\n'
            span_id: 1965
          ) (Token id:Id.Lit_Chars val:'\t(cd testrepo &&\n' span_id:1966) 
          (Token id:Id.Lit_Chars val:'\t\tgit reset --hard origin/master^\n' span_id:1967) (Token id:Id.Lit_Chars val:'\t\tgit config receive.denyCurrentBranch true) &&\n' span_id:1968) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1969) (Token id:Id.Lit_Chars val:'\techo >.git/foo  "To testrepo"  &&\n' span_id:1970) 
          (Token
            id: Id.Lit_Chars
            val: 
'\techo >>.git/foo "!\trefs/heads/master:refs/heads/master\t[remote rejected] (branch is currently checked out)" &&\n'
            span_id: 1971
          ) (Token id:Id.Lit_Chars val:'\n' span_id:1972) 
          (Token
            id: Id.Lit_Chars
            val: 
'\ttest_must_fail git push >.git/bar --porcelain  testrepo refs/heads/master:refs/heads/master &&\n'
            span_id: 1973
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp .git/foo .git/bar\n' span_id:1974)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push --porcelain --dry-run rejected' span_id:1981))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1985) 
          (Token id:Id.Lit_Chars val:'\tmk_empty testrepo &&\n' span_id:1986) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push testrepo refs/heads/master:refs/remotes/origin/master &&\n'
            span_id: 1987
          ) (Token id:Id.Lit_Chars val:'\t(cd testrepo &&\n' span_id:1988) 
          (Token id:Id.Lit_Chars val:'\t\tgit reset --hard origin/master\n' span_id:1989) (Token id:Id.Lit_Chars val:'\t\tgit config receive.denyCurrentBranch true) &&\n' span_id:1990) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1991) (Token id:Id.Lit_Chars val:'\techo >.git/foo  "To testrepo"  &&\n' span_id:1992) 
          (Token
            id: Id.Lit_Chars
            val: 
'\techo >>.git/foo "!\trefs/heads/master^:refs/heads/master\t[rejected] (non-fast-forward)" &&\n'
            span_id: 1993
          ) (Token id:Id.Lit_Chars val:'\techo >>.git/foo "Done" &&\n' span_id:1994) 
          (Token id:Id.Lit_Chars val:'\n' span_id:1995) 
          (Token
            id: Id.Lit_Chars
            val: 
'\ttest_must_fail git push >.git/bar --porcelain  --dry-run testrepo refs/heads/master^:refs/heads/master &&\n'
            span_id: 1996
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp .git/foo .git/bar\n' span_id:1997)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'push --prune' span_id:2004))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2008) 
          (Token
            id: Id.Lit_Chars
            val: '\tmk_test testrepo heads/master heads/second heads/foo heads/bar &&\n'
            span_id: 2009
          ) (Token id:Id.Lit_Chars val:'\tgit push --prune testrepo : &&\n' span_id:2010) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit heads/master &&\n'
            span_id: 2011
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_first_commit heads/second &&\n'
            span_id: 2012
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t! check_push_result testrepo $the_first_commit heads/foo heads/bar\n'
            span_id: 2013
          )
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'push --prune refspec' span_id:2020))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2024) 
          (Token
            id: Id.Lit_Chars
            val: '\tmk_test testrepo tmp/master tmp/second tmp/foo tmp/bar &&\n'
            span_id: 2025
          ) (Token id:Id.Lit_Chars val:'\tgit push --prune testrepo "refs/heads/*:refs/tmp/*" &&\n' span_id:2026) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit tmp/master &&\n'
            span_id: 2027
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_first_commit tmp/second &&\n'
            span_id: 2028
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t! check_push_result testrepo $the_first_commit tmp/foo tmp/bar\n'
            span_id: 2029
          )
        )
      }
    )
    (command.ForEach
      iter_name: configsection
      iter_words: [{(transfer)} {(receive)}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (C {(test_expect_success)} 
              {
                (DQ ('push to update a ref hidden by ') ($ Id.VSub_DollarName '$configsection') 
                  (.hiderefs)
                )
              } 
              {
                (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2055) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\tmk_test testrepo heads/master hidden/one hidden/two hidden/three &&\n'
                    span_id: 2056
                  ) (Token id:Id.Lit_Chars val:'\t\t(\n' span_id:2057) 
                  (Token id:Id.Lit_Chars val:'\t\t\tcd testrepo &&\n' span_id:2058) (Token id:Id.Lit_Chars val:'\t\t\tgit config $configsection.hiderefs refs/hidden\n' span_id:2059) 
                  (Token id:Id.Lit_Chars val:'\t\t) &&\n' span_id:2060) (Token id:Id.Lit_Chars val:'\n' span_id:2061) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t# push to unhidden ref succeeds normally\n'
                    span_id: 2062
                  ) (Token id:Id.Lit_Chars val:'\t\tgit push testrepo master:refs/heads/master &&\n' span_id:2063) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\tcheck_push_result testrepo $the_commit heads/master &&\n'
                    span_id: 2064
                  ) (Token id:Id.Lit_Chars val:'\n' span_id:2065) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t# push to update a hidden ref should fail\n'
                    span_id: 2066
                  ) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\ttest_must_fail git push testrepo master:refs/hidden/one &&\n'
                    span_id: 2067
                  ) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\tcheck_push_result testrepo $the_first_commit hidden/one &&\n'
                    span_id: 2068
                  ) (Token id:Id.Lit_Chars val:'\n' span_id:2069) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t# push to delete a hidden ref should fail\n'
                    span_id: 2070
                  ) (Token id:Id.Lit_Chars val:'\t\ttest_must_fail git push testrepo :refs/hidden/two &&\n' span_id:2071) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\tcheck_push_result testrepo $the_first_commit hidden/two &&\n'
                    span_id: 2072
                  ) (Token id:Id.Lit_Chars val:'\n' span_id:2073) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t# idempotent push to update a hidden ref should fail\n'
                    span_id: 2074
                  ) 
                  (Token
                    id: Id.Lit_Chars
                    val: 
'\t\ttest_must_fail git push testrepo $the_first_commit:refs/hidden/three &&\n'
                    span_id: 2075
                  ) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\tcheck_push_result testrepo $the_first_commit hidden/three\n'
                    span_id: 2076
                  ) (Token id:Id.Lit_Chars val:'\t' span_id:2077)
                )
              }
            )
          ]
        )
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch exact SHA1' span_id:2086))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2090) 
          (Token
            id: Id.Lit_Chars
            val: '\tmk_test testrepo heads/master hidden/one &&\n'
            span_id: 2091
          ) (Token id:Id.Lit_Chars val:'\tgit push testrepo master:refs/hidden/one &&\n' span_id:2092) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:2093) (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2094) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config transfer.hiderefs refs/hidden\n'
            span_id: 2095
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2096) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_push_result testrepo $the_commit hidden/one &&\n'
            span_id: 2097
          ) (Token id:Id.Lit_Chars val:'\n' span_id:2098) 
          (Token id:Id.Lit_Chars val:'\tmk_child testrepo child &&\n' span_id:2099) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2100) 
          (Token id:Id.Lit_Chars val:'\t\tcd child &&\n' span_id:2101) (Token id:Id.Lit_Chars val:'\n' span_id:2102) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t# make sure $the_commit does not exist here\n'
            span_id: 2103
          ) (Token id:Id.Lit_Chars val:'\t\tgit repack -a -d &&\n' span_id:2104) 
          (Token id:Id.Lit_Chars val:'\t\tgit prune &&\n' span_id:2105) (Token id:Id.Lit_Chars val:'\t\ttest_must_fail git cat-file -t $the_commit &&\n' span_id:2106) 
          (Token id:Id.Lit_Chars val:'\n' span_id:2107) (Token id:Id.Lit_Chars val:'\t\t# fetching the hidden object should fail by default\n' span_id:2108) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_must_fail git fetch -v ../testrepo $the_commit:refs/heads/copy &&\n'
            span_id: 2109
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_must_fail git rev-parse --verify refs/heads/copy &&\n'
            span_id: 2110
          ) (Token id:Id.Lit_Chars val:'\n' span_id:2111) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t# the server side can allow it to succeed\n'
            span_id: 2112
          ) (Token id:Id.Lit_Chars val:'\t\t(\n' span_id:2113) 
          (Token id:Id.Lit_Chars val:'\t\t\tcd ../testrepo &&\n' span_id:2114) (Token id:Id.Lit_Chars val:'\t\t\tgit config uploadpack.allowtipsha1inwant true\n' span_id:2115) 
          (Token id:Id.Lit_Chars val:'\t\t) &&\n' span_id:2116) (Token id:Id.Lit_Chars val:'\n' span_id:2117) 
          (Token
            id: Id.Lit_Chars
            val: 
'\t\tgit fetch -v ../testrepo $the_commit:refs/heads/copy master:refs/heads/extra &&\n'
            span_id: 2118
          ) (Token id:Id.Lit_Chars val:'\t\tcat >expect <<-EOF &&\n' span_id:2119) 
          (Token id:Id.Lit_Chars val:'\t\t$the_commit\n' span_id:2120) (Token id:Id.Lit_Chars val:'\t\t$the_first_commit\n' span_id:2121) 
          (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:2122) (Token id:Id.Lit_Chars val:'\t\t{\n' span_id:2123) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t\tgit rev-parse --verify refs/heads/copy &&\n'
            span_id: 2124
          ) (Token id:Id.Lit_Chars val:'\t\t\tgit rev-parse --verify refs/heads/extra\n' span_id:2125) 
          (Token id:Id.Lit_Chars val:'\t\t} >actual &&\n' span_id:2126) (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:2127) 
          (Token id:Id.Lit_Chars val:'\t)\n' span_id:2128)
        )
      }
    )
    (command.ForEach
      iter_name: configallowtipsha1inwant
      iter_words: [{(true)} {(false)}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (C {(test_expect_success)} 
              {
                (DQ ('shallow fetch reachable SHA1 (but not a ref), allowtipsha1inwant=') 
                  ($ Id.VSub_DollarName '$configallowtipsha1inwant')
                )
              } 
              {
                (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2153) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\tmk_empty testrepo &&\n'
                    span_id: 2154
                  ) (Token id:Id.Lit_Chars val:'\t\t(\n' span_id:2155) 
                  (Token id:Id.Lit_Chars val:'\t\t\tcd testrepo &&\n' span_id:2156) 
                  (Token
                    id: Id.Lit_Chars
                    val: 
'\t\t\tgit config uploadpack.allowtipsha1inwant $configallowtipsha1inwant &&\n'
                    span_id: 2157
                  ) (Token id:Id.Lit_Chars val:'\t\t\tgit commit --allow-empty -m foo &&\n' span_id:2158) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tgit commit --allow-empty -m bar\n'
                    span_id: 2159
                  ) (Token id:Id.Lit_Chars val:'\t\t) &&\n' span_id:2160) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\tSHA1=$(git --git-dir=testrepo/.git rev-parse HEAD^) &&\n'
                    span_id: 2161
                  ) (Token id:Id.Lit_Chars val:'\t\tmk_empty shallow &&\n' span_id:2162) 
                  (Token id:Id.Lit_Chars val:'\t\t(\n' span_id:2163) (Token id:Id.Lit_Chars val:'\t\t\tcd shallow &&\n' span_id:2164) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\ttest_must_fail git fetch --depth=1 ../testrepo/.git $SHA1 &&\n'
                    span_id: 2165
                  ) 
                  (Token
                    id: Id.Lit_Chars
                    val: 
'\t\t\tgit --git-dir=../testrepo/.git config uploadpack.allowreachablesha1inwant true &&\n'
                    span_id: 2166
                  ) (Token id:Id.Lit_Chars val:'\t\t\tgit fetch --depth=1 ../testrepo/.git $SHA1 &&\n' span_id:2167) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tgit cat-file commit $SHA1\n'
                    span_id: 2168
                  ) (Token id:Id.Lit_Chars val:'\t\t)\n' span_id:2169) (Token id:Id.Lit_Chars val:'\t' span_id:2170)
                )
              }
            )
            (C {(test_expect_success)} 
              {
                (DQ ('deny fetch unreachable SHA1, allowtipsha1inwant=') 
                  ($ Id.VSub_DollarName '$configallowtipsha1inwant')
                )
              } 
              {
                (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2183) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\tmk_empty testrepo &&\n'
                    span_id: 2184
                  ) (Token id:Id.Lit_Chars val:'\t\t(\n' span_id:2185) 
                  (Token id:Id.Lit_Chars val:'\t\t\tcd testrepo &&\n' span_id:2186) 
                  (Token
                    id: Id.Lit_Chars
                    val: 
'\t\t\tgit config uploadpack.allowtipsha1inwant $configallowtipsha1inwant &&\n'
                    span_id: 2187
                  ) (Token id:Id.Lit_Chars val:'\t\t\tgit commit --allow-empty -m foo &&\n' span_id:2188) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tgit commit --allow-empty -m bar &&\n'
                    span_id: 2189
                  ) (Token id:Id.Lit_Chars val:'\t\t\tgit commit --allow-empty -m xyz\n' span_id:2190) 
                  (Token id:Id.Lit_Chars val:'\t\t) &&\n' span_id:2191) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\tSHA1_1=$(git --git-dir=testrepo/.git rev-parse HEAD^^) &&\n'
                    span_id: 2192
                  ) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\tSHA1_2=$(git --git-dir=testrepo/.git rev-parse HEAD^) &&\n'
                    span_id: 2193
                  ) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\tSHA1_3=$(git --git-dir=testrepo/.git rev-parse HEAD) &&\n'
                    span_id: 2194
                  ) (Token id:Id.Lit_Chars val:'\t\t(\n' span_id:2195) 
                  (Token id:Id.Lit_Chars val:'\t\t\tcd testrepo &&\n' span_id:2196) (Token id:Id.Lit_Chars val:'\t\t\tgit reset --hard $SHA1_2 &&\n' span_id:2197) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tgit cat-file commit $SHA1_1 &&\n'
                    span_id: 2198
                  ) (Token id:Id.Lit_Chars val:'\t\t\tgit cat-file commit $SHA1_3\n' span_id:2199) 
                  (Token id:Id.Lit_Chars val:'\t\t) &&\n' span_id:2200) (Token id:Id.Lit_Chars val:'\t\tmk_empty shallow &&\n' span_id:2201) 
                  (Token id:Id.Lit_Chars val:'\t\t(\n' span_id:2202) (Token id:Id.Lit_Chars val:'\t\t\tcd shallow &&\n' span_id:2203) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\ttest_must_fail ok=sigpipe git fetch ../testrepo/.git $SHA1_3 &&\n'
                    span_id: 2204
                  ) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\ttest_must_fail ok=sigpipe git fetch ../testrepo/.git $SHA1_1 &&\n'
                    span_id: 2205
                  ) 
                  (Token
                    id: Id.Lit_Chars
                    val: 
'\t\t\tgit --git-dir=../testrepo/.git config uploadpack.allowreachablesha1inwant true &&\n'
                    span_id: 2206
                  ) (Token id:Id.Lit_Chars val:'\t\t\tgit fetch ../testrepo/.git $SHA1_1 &&\n' span_id:2207) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tgit cat-file commit $SHA1_1 &&\n'
                    span_id: 2208
                  ) (Token id:Id.Lit_Chars val:'\t\t\ttest_must_fail git cat-file commit $SHA1_2 &&\n' span_id:2209) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tgit fetch ../testrepo/.git $SHA1_2 &&\n'
                    span_id: 2210
                  ) (Token id:Id.Lit_Chars val:'\t\t\tgit cat-file commit $SHA1_2 &&\n' span_id:2211) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\ttest_must_fail ok=sigpipe git fetch ../testrepo/.git $SHA1_3\n'
                    span_id: 2212
                  ) (Token id:Id.Lit_Chars val:'\t\t)\n' span_id:2213) (Token id:Id.Lit_Chars val:'\t' span_id:2214)
                )
              }
            )
          ]
        )
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'fetch follows tags by default' span_id:2223))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2227) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:2228) (Token id:Id.Lit_Chars val:'\trm -fr src dst &&\n' span_id:2229) 
          (Token id:Id.Lit_Chars val:'\tgit init src &&\n' span_id:2230) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2231) 
          (Token id:Id.Lit_Chars val:'\t\tcd src &&\n' span_id:2232) (Token id:Id.Lit_Chars val:'\t\tgit pull ../testrepo master &&\n' span_id:2233) 
          (Token id:Id.Lit_Chars val:'\t\tgit tag -m "annotated" tag &&\n' span_id:2234) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref >tmp1 &&\n' span_id:2235) 
          (Token id:Id.Lit_Chars val:'\t\t(\n' span_id:2236) (Token id:Id.Lit_Chars val:'\t\t\tcat tmp1\n' span_id:2237) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t\tsed -n "s|refs/heads/master$|refs/remotes/origin/master|p" tmp1\n'
            span_id: 2238
          ) (Token id:Id.Lit_Chars val:'\t\t) |\n' span_id:2239) 
          (Token id:Id.Lit_Chars val:'\t\tsort -k 3 >../expect\n' span_id:2240) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2241) 
          (Token id:Id.Lit_Chars val:'\tgit init dst &&\n' span_id:2242) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2243) 
          (Token id:Id.Lit_Chars val:'\t\tcd dst &&\n' span_id:2244) (Token id:Id.Lit_Chars val:'\t\tgit remote add origin ../src &&\n' span_id:2245) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config branch.master.remote origin &&\n'
            span_id: 2246
          ) (Token id:Id.Lit_Chars val:'\t\tgit config branch.master.merge refs/heads/master &&\n' span_id:2247) 
          (Token id:Id.Lit_Chars val:'\t\tgit pull &&\n' span_id:2248) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref >../actual\n' span_id:2249) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2250) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:2251)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'pushing a specific ref applies remote.$name.push as refmap'
            span_id: 2258
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2262) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:2263) (Token id:Id.Lit_Chars val:'\trm -fr src dst &&\n' span_id:2264) 
          (Token id:Id.Lit_Chars val:'\tgit init src &&\n' span_id:2265) (Token id:Id.Lit_Chars val:'\tgit init --bare dst &&\n' span_id:2266) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:2267) (Token id:Id.Lit_Chars val:'\t\tcd src &&\n' span_id:2268) 
          (Token id:Id.Lit_Chars val:'\t\tgit pull ../testrepo master &&\n' span_id:2269) (Token id:Id.Lit_Chars val:'\t\tgit branch next &&\n' span_id:2270) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config remote.dst.url ../dst &&\n'
            span_id: 2271
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config remote.dst.push "+refs/heads/*:refs/remotes/src/*" &&\n'
            span_id: 2272
          ) (Token id:Id.Lit_Chars val:'\t\tgit push dst master &&\n' span_id:2273) 
          (Token id:Id.Lit_Chars val:'\t\tgit show-ref refs/heads/master |\n' span_id:2274) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tsed -e "s|refs/heads/|refs/remotes/src/|" >../dst/expect\n'
            span_id: 2275
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2276) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2277) 
          (Token id:Id.Lit_Chars val:'\t\tcd dst &&\n' span_id:2278) (Token id:Id.Lit_Chars val:'\t\ttest_must_fail git show-ref refs/heads/next &&\n' span_id:2279) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_must_fail git show-ref refs/heads/master &&\n'
            span_id: 2280
          ) (Token id:Id.Lit_Chars val:'\t\tgit show-ref refs/remotes/src/master >actual\n' span_id:2281) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2282) (Token id:Id.Lit_Chars val:'\ttest_cmp dst/expect dst/actual\n' span_id:2283)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'with no remote.$name.push, it is not used as refmap'
            span_id: 2290
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2294) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:2295) (Token id:Id.Lit_Chars val:'\trm -fr src dst &&\n' span_id:2296) 
          (Token id:Id.Lit_Chars val:'\tgit init src &&\n' span_id:2297) (Token id:Id.Lit_Chars val:'\tgit init --bare dst &&\n' span_id:2298) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:2299) (Token id:Id.Lit_Chars val:'\t\tcd src &&\n' span_id:2300) 
          (Token id:Id.Lit_Chars val:'\t\tgit pull ../testrepo master &&\n' span_id:2301) (Token id:Id.Lit_Chars val:'\t\tgit branch next &&\n' span_id:2302) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config remote.dst.url ../dst &&\n'
            span_id: 2303
          ) (Token id:Id.Lit_Chars val:'\t\tgit config push.default matching &&\n' span_id:2304) 
          (Token id:Id.Lit_Chars val:'\t\tgit push dst master &&\n' span_id:2305) (Token id:Id.Lit_Chars val:'\t\tgit show-ref refs/heads/master >../dst/expect\n' span_id:2306) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2307) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2308) 
          (Token id:Id.Lit_Chars val:'\t\tcd dst &&\n' span_id:2309) (Token id:Id.Lit_Chars val:'\t\ttest_must_fail git show-ref refs/heads/next &&\n' span_id:2310) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit show-ref refs/heads/master >actual\n'
            span_id: 2311
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2312) 
          (Token id:Id.Lit_Chars val:'\ttest_cmp dst/expect dst/actual\n' span_id:2313)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'with no remote.$name.push, upstream mapping is used'
            span_id: 2320
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2324) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:2325) (Token id:Id.Lit_Chars val:'\trm -fr src dst &&\n' span_id:2326) 
          (Token id:Id.Lit_Chars val:'\tgit init src &&\n' span_id:2327) (Token id:Id.Lit_Chars val:'\tgit init --bare dst &&\n' span_id:2328) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:2329) (Token id:Id.Lit_Chars val:'\t\tcd src &&\n' span_id:2330) 
          (Token id:Id.Lit_Chars val:'\t\tgit pull ../testrepo master &&\n' span_id:2331) (Token id:Id.Lit_Chars val:'\t\tgit branch next &&\n' span_id:2332) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config remote.dst.url ../dst &&\n'
            span_id: 2333
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config remote.dst.fetch "+refs/heads/*:refs/remotes/dst/*" &&\n'
            span_id: 2334
          ) (Token id:Id.Lit_Chars val:'\t\tgit config push.default upstream &&\n' span_id:2335) 
          (Token id:Id.Lit_Chars val:'\n' span_id:2336) (Token id:Id.Lit_Chars val:'\t\tgit config branch.master.merge refs/heads/trunk &&\n' span_id:2337) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config branch.master.remote dst &&\n'
            span_id: 2338
          ) (Token id:Id.Lit_Chars val:'\n' span_id:2339) 
          (Token id:Id.Lit_Chars val:'\t\tgit push dst master &&\n' span_id:2340) (Token id:Id.Lit_Chars val:'\t\tgit show-ref refs/heads/master |\n' span_id:2341) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tsed -e "s|refs/heads/master|refs/heads/trunk|" >../dst/expect\n'
            span_id: 2342
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2343) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2344) 
          (Token id:Id.Lit_Chars val:'\t\tcd dst &&\n' span_id:2345) (Token id:Id.Lit_Chars val:'\t\ttest_must_fail git show-ref refs/heads/master &&\n' span_id:2346) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_must_fail git show-ref refs/heads/next &&\n'
            span_id: 2347
          ) (Token id:Id.Lit_Chars val:'\t\tgit show-ref refs/heads/trunk >actual\n' span_id:2348) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2349) (Token id:Id.Lit_Chars val:'\ttest_cmp dst/expect dst/actual\n' span_id:2350)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push does not follow tags by default' span_id:2357))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2361) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:2362) (Token id:Id.Lit_Chars val:'\trm -fr src dst &&\n' span_id:2363) 
          (Token id:Id.Lit_Chars val:'\tgit init src &&\n' span_id:2364) (Token id:Id.Lit_Chars val:'\tgit init --bare dst &&\n' span_id:2365) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:2366) (Token id:Id.Lit_Chars val:'\t\tcd src &&\n' span_id:2367) 
          (Token id:Id.Lit_Chars val:'\t\tgit pull ../testrepo master &&\n' span_id:2368) (Token id:Id.Lit_Chars val:'\t\tgit tag -m "annotated" tag &&\n' span_id:2369) 
          (Token id:Id.Lit_Chars val:'\t\tgit checkout -b another &&\n' span_id:2370) (Token id:Id.Lit_Chars val:'\t\tgit commit --allow-empty -m "future commit" &&\n' span_id:2371) 
          (Token id:Id.Lit_Chars val:'\t\tgit tag -m "future" future &&\n' span_id:2372) (Token id:Id.Lit_Chars val:'\t\tgit checkout master &&\n' span_id:2373) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit for-each-ref refs/heads/master >../expect &&\n'
            span_id: 2374
          ) (Token id:Id.Lit_Chars val:'\t\tgit push ../dst master\n' span_id:2375) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2376) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2377) 
          (Token id:Id.Lit_Chars val:'\t\tcd dst &&\n' span_id:2378) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref >../actual\n' span_id:2379) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2380) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:2381)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push --follow-tag only pushes relevant tags' span_id:2388))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2392) 
          (Token id:Id.Lit_Chars val:'\tmk_test testrepo heads/master &&\n' span_id:2393) (Token id:Id.Lit_Chars val:'\trm -fr src dst &&\n' span_id:2394) 
          (Token id:Id.Lit_Chars val:'\tgit init src &&\n' span_id:2395) (Token id:Id.Lit_Chars val:'\tgit init --bare dst &&\n' span_id:2396) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:2397) (Token id:Id.Lit_Chars val:'\t\tcd src &&\n' span_id:2398) 
          (Token id:Id.Lit_Chars val:'\t\tgit pull ../testrepo master &&\n' span_id:2399) (Token id:Id.Lit_Chars val:'\t\tgit tag -m "annotated" tag &&\n' span_id:2400) 
          (Token id:Id.Lit_Chars val:'\t\tgit checkout -b another &&\n' span_id:2401) (Token id:Id.Lit_Chars val:'\t\tgit commit --allow-empty -m "future commit" &&\n' span_id:2402) 
          (Token id:Id.Lit_Chars val:'\t\tgit tag -m "future" future &&\n' span_id:2403) (Token id:Id.Lit_Chars val:'\t\tgit checkout master &&\n' span_id:2404) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit for-each-ref refs/heads/master refs/tags/tag >../expect\n'
            span_id: 2405
          ) (Token id:Id.Lit_Chars val:'\t\tgit push --follow-tag ../dst master\n' span_id:2406) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2407) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2408) 
          (Token id:Id.Lit_Chars val:'\t\tcd dst &&\n' span_id:2409) (Token id:Id.Lit_Chars val:'\t\tgit for-each-ref >../actual\n' span_id:2410) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2411) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:2412)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push --no-thin must produce non-thin pack' span_id:2419))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2423) 
          (Token id:Id.Lit_Chars val:'\tcat >>path1 <<\\EOF &&\n' span_id:2424) 
          (Token
            id: Id.Lit_Chars
            val: 'keep base version of path1 big enough, compared to the new changes\n'
            span_id: 2425
          ) (Token id:Id.Lit_Chars val:'later, in order to pass size heuristics in\n' span_id:2426) 
          (Token id:Id.Lit_Chars val:'builtin/pack-objects.c:try_delta()\n' span_id:2427) (Token id:Id.Lit_Chars val:'EOF\n' span_id:2428) 
          (Token id:Id.Lit_Chars val:'\tgit commit -am initial &&\n' span_id:2429) (Token id:Id.Lit_Chars val:'\tgit init no-thin &&\n' span_id:2430) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit --git-dir=no-thin/.git config receive.unpacklimit 0 &&\n'
            span_id: 2431
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push no-thin/.git refs/heads/master:refs/heads/foo &&\n'
            span_id: 2432
          ) (Token id:Id.Lit_Chars val:'\techo modified >> path1 &&\n' span_id:2433) 
          (Token id:Id.Lit_Chars val:'\tgit commit -am modified &&\n' span_id:2434) (Token id:Id.Lit_Chars val:'\tgit repack -adf &&\n' span_id:2435) 
          (Token
            id: Id.Lit_Chars
            val: '\trcvpck="git receive-pack --reject-thin-pack-for-testing" &&\n'
            span_id: 2436
          ) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tgit push --no-thin --receive-pack="$rcvpck" no-thin/.git refs/heads/master:refs/heads/foo\n'
            span_id: 2437
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'pushing a tag pushes the tagged object' span_id:2444))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2448) 
          (Token id:Id.Lit_Chars val:'\trm -rf dst.git &&\n' span_id:2449) 
          (Token
            id: Id.Lit_Chars
            val: '\tblob=$(echo unreferenced | git hash-object -w --stdin) &&\n'
            span_id: 2450
          ) (Token id:Id.Lit_Chars val:'\tgit tag -m foo tag-of-blob $blob &&\n' span_id:2451) 
          (Token id:Id.Lit_Chars val:'\tgit init --bare dst.git &&\n' span_id:2452) (Token id:Id.Lit_Chars val:'\tgit push dst.git tag-of-blob &&\n' span_id:2453) 
          (Token
            id: Id.Lit_Chars
            val: '\t# the receiving index-pack should have noticed\n'
            span_id: 2454
          ) (Token id:Id.Lit_Chars val:'\t# any problems, but we double check\n' span_id:2455) 
          (Token id:Id.Lit_Chars val:'\techo unreferenced >expect &&\n' span_id:2456) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit --git-dir=dst.git cat-file blob tag-of-blob >actual &&\n'
            span_id: 2457
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:2458)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'push into bare respects core.logallrefupdates' span_id:2465))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2469) 
          (Token id:Id.Lit_Chars val:'\trm -rf dst.git &&\n' span_id:2470) (Token id:Id.Lit_Chars val:'\tgit init --bare dst.git &&\n' span_id:2471) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit -C dst.git config core.logallrefupdates true &&\n'
            span_id: 2472
          ) (Token id:Id.Lit_Chars val:'\n' span_id:2473) 
          (Token
            id: Id.Lit_Chars
            val: '\t# double push to test both with and without\n'
            span_id: 2474
          ) (Token id:Id.Lit_Chars val:'\t# the actual pack transfer\n' span_id:2475) 
          (Token id:Id.Lit_Chars val:'\tgit push dst.git master:one &&\n' span_id:2476) (Token id:Id.Lit_Chars val:'\techo "one@{0} push" >expect &&\n' span_id:2477) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit -C dst.git log -g --format="%gd %gs" one >actual &&\n'
            span_id: 2478
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual &&\n' span_id:2479) 
          (Token id:Id.Lit_Chars val:'\n' span_id:2480) (Token id:Id.Lit_Chars val:'\tgit push dst.git master:two &&\n' span_id:2481) 
          (Token id:Id.Lit_Chars val:'\techo "two@{0} push" >expect &&\n' span_id:2482) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit -C dst.git log -g --format="%gd %gs" two >actual &&\n'
            span_id: 2483
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:2484)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'fetch into bare respects core.logallrefupdates' span_id:2491))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2495) 
          (Token id:Id.Lit_Chars val:'\trm -rf dst.git &&\n' span_id:2496) (Token id:Id.Lit_Chars val:'\tgit init --bare dst.git &&\n' span_id:2497) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:2498) (Token id:Id.Lit_Chars val:'\t\tcd dst.git &&\n' span_id:2499) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config core.logallrefupdates true &&\n'
            span_id: 2500
          ) (Token id:Id.Lit_Chars val:'\n' span_id:2501) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t# as above, we double-fetch to test both\n'
            span_id: 2502
          ) (Token id:Id.Lit_Chars val:'\t\t# with and without pack transfer\n' span_id:2503) 
          (Token id:Id.Lit_Chars val:'\t\tgit fetch .. master:one &&\n' span_id:2504) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "one@{0} fetch .. master:one: storing head" >expect &&\n'
            span_id: 2505
          ) (Token id:Id.Lit_Chars val:'\t\tgit log -g --format="%gd %gs" one >actual &&\n' span_id:2506) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual &&\n' span_id:2507) (Token id:Id.Lit_Chars val:'\n' span_id:2508) 
          (Token id:Id.Lit_Chars val:'\t\tgit fetch .. master:two &&\n' span_id:2509) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "two@{0} fetch .. master:two: storing head" >expect &&\n'
            span_id: 2510
          ) (Token id:Id.Lit_Chars val:'\t\tgit log -g --format="%gd %gs" two >actual &&\n' span_id:2511) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp expect actual\n' span_id:2512) (Token id:Id.Lit_Chars val:'\t)\n' span_id:2513)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'receive.denyCurrentBranch = updateInstead' span_id:2520))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2524) 
          (Token id:Id.Lit_Chars val:'\tgit push testrepo master &&\n' span_id:2525) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2526) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2527) (Token id:Id.Lit_Chars val:'\t\tgit reset --hard &&\n' span_id:2528) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config receive.denyCurrentBranch updateInstead\n'
            span_id: 2529
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2530) 
          (Token id:Id.Lit_Chars val:'\ttest_commit third path2 &&\n' span_id:2531) (Token id:Id.Lit_Chars val:'\n' span_id:2532) 
          (Token
            id: Id.Lit_Chars
            val: '\t# Try pushing into a repository with pristine working tree\n'
            span_id: 2533
          ) (Token id:Id.Lit_Chars val:'\tgit push testrepo master &&\n' span_id:2534) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:2535) (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2536) 
          (Token id:Id.Lit_Chars val:'\t\tgit update-index -q --refresh &&\n' span_id:2537) (Token id:Id.Lit_Chars val:'\t\tgit diff-files --quiet -- &&\n' span_id:2538) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit diff-index --quiet --cached HEAD -- &&\n'
            span_id: 2539
          ) (Token id:Id.Lit_Chars val:'\t\ttest third = "$(cat path2)" &&\n' span_id:2540) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest $(git -C .. rev-parse HEAD) = $(git rev-parse HEAD)\n'
            span_id: 2541
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2542) (Token id:Id.Lit_Chars val:'\n' span_id:2543) 
          (Token
            id: Id.Lit_Chars
            val: '\t# Try pushing into a repository with working tree needing a refresh\n'
            span_id: 2544
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2545) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2546) (Token id:Id.Lit_Chars val:'\t\tgit reset --hard HEAD^ &&\n' span_id:2547) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&\n'
            span_id: 2548
          ) (Token id:Id.Lit_Chars val:'\t\ttest-chmtime +100 path1\n' span_id:2549) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2550) (Token id:Id.Lit_Chars val:'\tgit push testrepo master &&\n' span_id:2551) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:2552) (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2553) 
          (Token id:Id.Lit_Chars val:'\t\tgit update-index -q --refresh &&\n' span_id:2554) (Token id:Id.Lit_Chars val:'\t\tgit diff-files --quiet -- &&\n' span_id:2555) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit diff-index --quiet --cached HEAD -- &&\n'
            span_id: 2556
          ) (Token id:Id.Lit_Chars val:'\t\ttest_cmp ../path1 path1 &&\n' span_id:2557) 
          (Token id:Id.Lit_Chars val:'\t\ttest third = "$(cat path2)" &&\n' span_id:2558) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest $(git -C .. rev-parse HEAD) = $(git rev-parse HEAD)\n'
            span_id: 2559
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2560) (Token id:Id.Lit_Chars val:'\n' span_id:2561) 
          (Token id:Id.Lit_Chars val:'\t# Update what is to be pushed\n' span_id:2562) (Token id:Id.Lit_Chars val:'\ttest_commit fourth path2 &&\n' span_id:2563) 
          (Token id:Id.Lit_Chars val:'\n' span_id:2564) 
          (Token
            id: Id.Lit_Chars
            val: '\t# Try pushing into a repository with a dirty working tree\n'
            span_id: 2565
          ) (Token id:Id.Lit_Chars val:'\t# (1) the working tree updated\n' span_id:2566) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:2567) (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2568) 
          (Token id:Id.Lit_Chars val:'\t\techo changed >path1\n' span_id:2569) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2570) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git push testrepo master &&\n'
            span_id: 2571
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2572) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2573) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&\n'
            span_id: 2574
          ) (Token id:Id.Lit_Chars val:'\t\tgit diff --quiet --cached &&\n' span_id:2575) 
          (Token id:Id.Lit_Chars val:'\t\ttest changed = "$(cat path1)"\n' span_id:2576) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2577) (Token id:Id.Lit_Chars val:'\n' span_id:2578) 
          (Token id:Id.Lit_Chars val:'\t# (2) the index updated\n' span_id:2579) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2580) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2581) (Token id:Id.Lit_Chars val:'\t\techo changed >path1 &&\n' span_id:2582) 
          (Token id:Id.Lit_Chars val:'\t\tgit add path1\n' span_id:2583) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2584) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git push testrepo master &&\n'
            span_id: 2585
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2586) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2587) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&\n'
            span_id: 2588
          ) (Token id:Id.Lit_Chars val:'\t\tgit diff --quiet &&\n' span_id:2589) 
          (Token id:Id.Lit_Chars val:'\t\ttest changed = "$(cat path1)"\n' span_id:2590) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2591) (Token id:Id.Lit_Chars val:'\n' span_id:2592) 
          (Token
            id: Id.Lit_Chars
            val: '\t# Introduce a new file in the update\n'
            span_id: 2593
          ) (Token id:Id.Lit_Chars val:'\ttest_commit fifth path3 &&\n' span_id:2594) 
          (Token id:Id.Lit_Chars val:'\n' span_id:2595) 
          (Token
            id: Id.Lit_Chars
            val: '\t# (3) the working tree has an untracked file that would interfere\n'
            span_id: 2596
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2597) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2598) (Token id:Id.Lit_Chars val:'\t\tgit reset --hard &&\n' span_id:2599) 
          (Token id:Id.Lit_Chars val:'\t\techo changed >path3\n' span_id:2600) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2601) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git push testrepo master &&\n'
            span_id: 2602
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2603) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2604) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest $(git -C .. rev-parse HEAD^^) = $(git rev-parse HEAD) &&\n'
            span_id: 2605
          ) (Token id:Id.Lit_Chars val:'\t\tgit diff --quiet &&\n' span_id:2606) 
          (Token id:Id.Lit_Chars val:'\t\tgit diff --quiet --cached &&\n' span_id:2607) (Token id:Id.Lit_Chars val:'\t\ttest changed = "$(cat path3)"\n' span_id:2608) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2609) (Token id:Id.Lit_Chars val:'\n' span_id:2610) 
          (Token
            id: Id.Lit_Chars
            val: '\t# (4) the target changes to what gets pushed but it still is a change\n'
            span_id: 2611
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2612) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2613) (Token id:Id.Lit_Chars val:'\t\tgit reset --hard &&\n' span_id:2614) 
          (Token id:Id.Lit_Chars val:'\t\techo fifth >path3 &&\n' span_id:2615) (Token id:Id.Lit_Chars val:'\t\tgit add path3\n' span_id:2616) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2617) (Token id:Id.Lit_Chars val:'\ttest_must_fail git push testrepo master &&\n' span_id:2618) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:2619) (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2620) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest $(git -C .. rev-parse HEAD^^) = $(git rev-parse HEAD) &&\n'
            span_id: 2621
          ) (Token id:Id.Lit_Chars val:'\t\tgit diff --quiet &&\n' span_id:2622) 
          (Token id:Id.Lit_Chars val:'\t\ttest fifth = "$(cat path3)"\n' span_id:2623) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2624) (Token id:Id.Lit_Chars val:'\n' span_id:2625) 
          (Token id:Id.Lit_Chars val:'\t# (5) push into void\n' span_id:2626) (Token id:Id.Lit_Chars val:'\trm -fr void &&\n' span_id:2627) 
          (Token id:Id.Lit_Chars val:'\tgit init void &&\n' span_id:2628) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2629) 
          (Token id:Id.Lit_Chars val:'\t\tcd void &&\n' span_id:2630) (Token id:Id.Lit_Chars val:'\t\tgit config receive.denyCurrentBranch updateInstead\n' span_id:2631) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2632) (Token id:Id.Lit_Chars val:'\tgit push void master &&\n' span_id:2633) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:2634) (Token id:Id.Lit_Chars val:'\t\tcd void &&\n' span_id:2635) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest $(git -C .. rev-parse master) = $(git rev-parse HEAD) &&\n'
            span_id: 2636
          ) (Token id:Id.Lit_Chars val:'\t\tgit diff --quiet &&\n' span_id:2637) 
          (Token id:Id.Lit_Chars val:'\t\tgit diff --cached --quiet\n' span_id:2638) (Token id:Id.Lit_Chars val:'\t)\n' span_id:2639)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'updateInstead with push-to-checkout hook' span_id:2646))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2650) 
          (Token id:Id.Lit_Chars val:'\trm -fr testrepo &&\n' span_id:2651) (Token id:Id.Lit_Chars val:'\tgit init testrepo &&\n' span_id:2652) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:2653) (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2654) 
          (Token id:Id.Lit_Chars val:'\t\tgit pull .. master &&\n' span_id:2655) (Token id:Id.Lit_Chars val:'\t\tgit reset --hard HEAD^^ &&\n' span_id:2656) 
          (Token id:Id.Lit_Chars val:'\t\tgit tag initial &&\n' span_id:2657) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config receive.denyCurrentBranch updateInstead &&\n'
            span_id: 2658
          ) (Token id:Id.Lit_Chars val:'\t\twrite_script .git/hooks/push-to-checkout <<-\\EOF\n' span_id:2659) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo >&2 updating from $(git rev-parse HEAD)\n'
            span_id: 2660
          ) (Token id:Id.Lit_Chars val:'\t\techo >&2 updating to "$1"\n' span_id:2661) 
          (Token id:Id.Lit_Chars val:'\n' span_id:2662) (Token id:Id.Lit_Chars val:'\t\tgit update-index -q --refresh &&\n' span_id:2663) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit read-tree -u -m HEAD "$1" || {\n'
            span_id: 2664
          ) (Token id:Id.Lit_Chars val:'\t\t\tstatus=$?\n' span_id:2665) 
          (Token id:Id.Lit_Chars val:'\t\t\techo >&2 read-tree failed\n' span_id:2666) (Token id:Id.Lit_Chars val:'\t\t\texit $status\n' span_id:2667) 
          (Token id:Id.Lit_Chars val:'\t\t}\n' span_id:2668) (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:2669) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2670) (Token id:Id.Lit_Chars val:'\n' span_id:2671) 
          (Token id:Id.Lit_Chars val:'\t# Try pushing into a pristine\n' span_id:2672) (Token id:Id.Lit_Chars val:'\tgit push testrepo master &&\n' span_id:2673) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:2674) (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2675) 
          (Token id:Id.Lit_Chars val:'\t\tgit diff --quiet &&\n' span_id:2676) (Token id:Id.Lit_Chars val:'\t\tgit diff HEAD --quiet &&\n' span_id:2677) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest $(git -C .. rev-parse HEAD) = $(git rev-parse HEAD)\n'
            span_id: 2678
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2679) (Token id:Id.Lit_Chars val:'\n' span_id:2680) 
          (Token
            id: Id.Lit_Chars
            val: '\t# Try pushing into a repository with conflicting change\n'
            span_id: 2681
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2682) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2683) (Token id:Id.Lit_Chars val:'\t\tgit reset --hard initial &&\n' span_id:2684) 
          (Token id:Id.Lit_Chars val:'\t\techo conflicting >path2\n' span_id:2685) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2686) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git push testrepo master &&\n'
            span_id: 2687
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2688) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2689) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest $(git rev-parse initial) = $(git rev-parse HEAD) &&\n'
            span_id: 2690
          ) (Token id:Id.Lit_Chars val:'\t\ttest conflicting = "$(cat path2)" &&\n' span_id:2691) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit diff-index --quiet --cached HEAD\n'
            span_id: 2692
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2693) (Token id:Id.Lit_Chars val:'\n' span_id:2694) 
          (Token
            id: Id.Lit_Chars
            val: '\t# Try pushing into a repository with unrelated change\n'
            span_id: 2695
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2696) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2697) (Token id:Id.Lit_Chars val:'\t\tgit reset --hard initial &&\n' span_id:2698) 
          (Token id:Id.Lit_Chars val:'\t\techo unrelated >path1 &&\n' span_id:2699) (Token id:Id.Lit_Chars val:'\t\techo irrelevant >path5 &&\n' span_id:2700) 
          (Token id:Id.Lit_Chars val:'\t\tgit add path5\n' span_id:2701) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2702) 
          (Token id:Id.Lit_Chars val:'\tgit push testrepo master &&\n' span_id:2703) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2704) 
          (Token id:Id.Lit_Chars val:'\t\tcd testrepo &&\n' span_id:2705) (Token id:Id.Lit_Chars val:'\t\ttest "$(cat path1)" = unrelated &&\n' span_id:2706) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest "$(cat path5)" = irrelevant &&\n'
            span_id: 2707
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest "$(git diff --name-only --cached HEAD)" = path5 &&\n'
            span_id: 2708
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest $(git -C .. rev-parse HEAD) = $(git rev-parse HEAD)\n'
            span_id: 2709
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2710) (Token id:Id.Lit_Chars val:'\n' span_id:2711) 
          (Token id:Id.Lit_Chars val:'\t# push into void\n' span_id:2712) (Token id:Id.Lit_Chars val:'\trm -fr void &&\n' span_id:2713) 
          (Token id:Id.Lit_Chars val:'\tgit init void &&\n' span_id:2714) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2715) 
          (Token id:Id.Lit_Chars val:'\t\tcd void &&\n' span_id:2716) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config receive.denyCurrentBranch updateInstead &&\n'
            span_id: 2717
          ) (Token id:Id.Lit_Chars val:'\t\twrite_script .git/hooks/push-to-checkout <<-\\EOF\n' span_id:2718) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tif git rev-parse --quiet --verify HEAD\n'
            span_id: 2719
          ) (Token id:Id.Lit_Chars val:'\t\tthen\n' span_id:2720) 
          (Token id:Id.Lit_Chars val:'\t\t\thas_head=yes\n' span_id:2721) (Token id:Id.Lit_Chars val:'\t\t\techo >&2 updating from $(git rev-parse HEAD)\n' span_id:2722) 
          (Token id:Id.Lit_Chars val:'\t\telse\n' span_id:2723) (Token id:Id.Lit_Chars val:'\t\t\thas_head=no\n' span_id:2724) 
          (Token id:Id.Lit_Chars val:'\t\t\techo >&2 pushing into void\n' span_id:2725) (Token id:Id.Lit_Chars val:'\t\tfi\n' span_id:2726) 
          (Token id:Id.Lit_Chars val:'\t\techo >&2 updating to "$1"\n' span_id:2727) (Token id:Id.Lit_Chars val:'\n' span_id:2728) 
          (Token id:Id.Lit_Chars val:'\t\tgit update-index -q --refresh &&\n' span_id:2729) (Token id:Id.Lit_Chars val:'\t\tcase "$has_head" in\n' span_id:2730) 
          (Token id:Id.Lit_Chars val:'\t\tyes)\n' span_id:2731) (Token id:Id.Lit_Chars val:'\t\t\tgit read-tree -u -m HEAD "$1" ;;\n' span_id:2732) 
          (Token id:Id.Lit_Chars val:'\t\tno)\n' span_id:2733) (Token id:Id.Lit_Chars val:'\t\t\tgit read-tree -u -m "$1" ;;\n' span_id:2734) 
          (Token id:Id.Lit_Chars val:'\t\tesac || {\n' span_id:2735) (Token id:Id.Lit_Chars val:'\t\t\tstatus=$?\n' span_id:2736) 
          (Token id:Id.Lit_Chars val:'\t\t\techo >&2 read-tree failed\n' span_id:2737) (Token id:Id.Lit_Chars val:'\t\t\texit $status\n' span_id:2738) 
          (Token id:Id.Lit_Chars val:'\t\t}\n' span_id:2739) (Token id:Id.Lit_Chars val:'\t\tEOF\n' span_id:2740) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2741) (Token id:Id.Lit_Chars val:'\n' span_id:2742) 
          (Token id:Id.Lit_Chars val:'\tgit push void master &&\n' span_id:2743) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2744) 
          (Token id:Id.Lit_Chars val:'\t\tcd void &&\n' span_id:2745) (Token id:Id.Lit_Chars val:'\t\tgit diff --quiet &&\n' span_id:2746) 
          (Token id:Id.Lit_Chars val:'\t\tgit diff --cached --quiet &&\n' span_id:2747) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest $(git -C .. rev-parse HEAD) = $(git rev-parse HEAD)\n'
            span_id: 2748
          ) (Token id:Id.Lit_Chars val:'\t)\n' span_id:2749)
        )
      }
    )
    (C {(test_done)})
  ]
)