(CommandList
  children: [
    (FuncDef
      name: check
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:credential_opts)
                  op: Equal
                  rhs: {(SQ )}
                  spids: [20]
                )
              ]
              spids: [20]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:credential_cmd)
                  op: Equal
                  rhs: {($ VSub_Number "$1")}
                  spids: [23]
                )
              ]
              spids: [23]
            )
            (C {(shift)})
            (ForEach
              iter_name: arg
              iter_words: [{(DQ ($ VSub_At "$@"))}]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:credential_opts)
                          op: Equal
                          rhs: 
                            {
                              (DQ ($ VSub_Name "$credential_opts") (" -c credential.helper='") 
                                ($ VSub_Name "$arg") ("'")
                              )
                            }
                          spids: [44]
                        )
                      ]
                      spids: [44]
                    )
                  ]
                  spids: [41 53]
                )
              spids: [35 39]
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(read_chunk)}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(stdin)} spids:[58])]
                )
                (AndOr
                  children: [
                    (SimpleCommand
                      words: [{(read_chunk)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: -1
                          arg_word: {(expect-stdout)}
                          spids: [66]
                        )
                      ]
                    )
                    (AndOr
                      children: [
                        (SimpleCommand
                          words: [{(read_chunk)}]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: -1
                              arg_word: {(expect-stderr)}
                              spids: [74]
                            )
                          ]
                        )
                        (AndOr
                          children: [
                            (If
                              arms: [
                                (if_arm
                                  cond: [
                                    (Sentence
                                      child: 
                                        (Pipeline
                                          children: [
                                            (C {(eval)} 
                                              {
                                                (DQ ("git ") ($ VSub_Name "$credential_opts") 
                                                  (" credential ") ($ VSub_Name "$credential_cmd") (" <stdin >stdout 2>stderr")
                                                )
                                              }
                                            )
                                          ]
                                          negated: True
                                        )
                                      terminator: <Op_Semi ";">
                                    )
                                  ]
                                  action: [
                                    (AndOr
                                      children: [
                                        (C {(echo)} 
                                          {
                                            (DQ ("git credential failed with code ") 
                                              ($ VSub_QMark "$?")
                                            )
                                          }
                                        )
                                        (AndOr
                                          children: [(C {(cat)} {(stderr)}) (C {(false)})]
                                          op_id: Op_DAmp
                                        )
                                      ]
                                      op_id: Op_DAmp
                                    )
                                  ]
                                  spids: [-1 95]
                                )
                              ]
                              spids: [-1 118]
                            )
                            (AndOr
                              children: [
                                (C {(test_cmp)} {(expect-stdout)} {(stdout)})
                                (C {(test_cmp)} {(expect-stderr)} {(stderr)})
                              ]
                              op_id: Op_DAmp
                            )
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [17]
        )
      spids: [13 16]
    )
    (FuncDef
      name: read_chunk
      body: 
        (BraceGroup
          children: [
            (While
              cond: [(Sentence child:(C {(read)} {(line)}) terminator:<Op_Semi ";">)]
              body: 
                (DoGroup
                  children: [
                    (Case
                      to_match: {(DQ ($ VSub_Name "$line"))}
                      arms: [
                        (case_arm
                          pat_list: [{(--)}]
                          action: [(ControlFlow token:<ControlFlow_Break break>)]
                          spids: [167 168 172 -1]
                        )
                        (case_arm
                          pat_list: [{(Lit_Other "*")}]
                          action: [(C {(echo)} {(DQ ($ VSub_Name "$line"))})]
                          spids: [175 176 184 -1]
                        )
                      ]
                      spids: [158 164 187]
                    )
                  ]
                  spids: [155 190]
                )
            )
          ]
          spids: [145]
        )
      spids: [141 144]
    )
    (FuncDef
      name: helper_test_clean
      body: 
        (BraceGroup
          children: [
            (C {(reject)} {($ VSub_Number "$1")} {(https)} {(example.com)} {(store-user)})
            (C {(reject)} {($ VSub_Number "$1")} {(https)} {(example.com)} {(user1)})
            (C {(reject)} {($ VSub_Number "$1")} {(https)} {(example.com)} {(user2)})
            (C {(reject)} {($ VSub_Number "$1")} {(http)} {(path.tld)} {(user)})
            (C {(reject)} {($ VSub_Number "$1")} {(https)} {(timeout.tld)} {(user)})
          ]
          spids: [220]
        )
      spids: [216 219]
    )
    (FuncDef
      name: reject
      body: 
        (BraceGroup
          children: [
            (Pipeline
              children: [
                (Subshell
                  child: 
                    (CommandList
                      children: [
                        (C {(echo)} {(Lit_VarLike "protocol=") ($ VSub_Number "$2")})
                        (C {(echo)} {(Lit_VarLike "host=") ($ VSub_Number "$3")})
                        (C {(echo)} {(Lit_VarLike "username=") ($ VSub_Number "$4")})
                      ]
                    )
                  spids: [287 308]
                )
                (C {(git)} {(-c)} {(credential.helper) (Lit_Other "=") ($ VSub_Number "$1")} 
                  {(credential)} {(reject)}
                )
              ]
              negated: False
            )
          ]
          spids: [284]
        )
      spids: [280 283]
    )
    (FuncDef
      name: helper_test
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:HELPER)
                  op: Equal
                  rhs: {($ VSub_Number "$1")}
                  spids: [334]
                )
              ]
              spids: [334]
            )
            (C {(test_expect_success)} 
              {(DQ ("helper (") ($ VSub_Name "$HELPER") (") has no existing data"))} 
              {
                (SQ <"\n"> <"\t\tcheck fill $HELPER <<-\\EOF\n"> <"\t\tprotocol=https\n"> 
                  <"\t\thost=example.com\n"> <"\t\t--\n"> <"\t\tprotocol=https\n"> <"\t\thost=example.com\n"> <"\t\tusername=askpass-username\n"> 
                  <"\t\tpassword=askpass-password\n"> <"\t\t--\n"> <"\t\taskpass: Username for ">
                ) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <"https://example.com">) 
                (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <":\n"> <"\t\taskpass: Password for ">) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) 
                (SQ <"https://askpass-username@example.com">) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <":\n"> <"\t\tEOF\n"> <"\t">)
              }
            )
            (C {(test_expect_success)} {(DQ ("helper (") ($ VSub_Name "$HELPER") (") stores password"))} 
              {
                (SQ <"\n"> <"\t\tcheck approve $HELPER <<-\\EOF\n"> <"\t\tprotocol=https\n"> 
                  <"\t\thost=example.com\n"> <"\t\tusername=store-user\n"> <"\t\tpassword=store-pass\n"> <"\t\tEOF\n"> <"\t">
                )
              }
            )
            (C {(test_expect_success)} 
              {(DQ ("helper (") ($ VSub_Name "$HELPER") (") can retrieve password"))} 
              {
                (SQ <"\n"> <"\t\tcheck fill $HELPER <<-\\EOF\n"> <"\t\tprotocol=https\n"> 
                  <"\t\thost=example.com\n"> <"\t\t--\n"> <"\t\tprotocol=https\n"> <"\t\thost=example.com\n"> <"\t\tusername=store-user\n"> 
                  <"\t\tpassword=store-pass\n"> <"\t\t--\n"> <"\t\tEOF\n"> <"\t">
                )
              }
            )
            (C {(test_expect_success)} 
              {(DQ ("helper (") ($ VSub_Name "$HELPER") (") requires matching protocol"))} 
              {
                (SQ <"\n"> <"\t\tcheck fill $HELPER <<-\\EOF\n"> <"\t\tprotocol=http\n"> 
                  <"\t\thost=example.com\n"> <"\t\t--\n"> <"\t\tprotocol=http\n"> <"\t\thost=example.com\n"> <"\t\tusername=askpass-username\n"> 
                  <"\t\tpassword=askpass-password\n"> <"\t\t--\n"> <"\t\taskpass: Username for ">
                ) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <"http://example.com">) 
                (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <":\n"> <"\t\taskpass: Password for ">) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) 
                (SQ <"http://askpass-username@example.com">) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <":\n"> <"\t\tEOF\n"> <"\t">)
              }
            )
            (C {(test_expect_success)} 
              {(DQ ("helper (") ($ VSub_Name "$HELPER") (") requires matching host"))} 
              {
                (SQ <"\n"> <"\t\tcheck fill $HELPER <<-\\EOF\n"> <"\t\tprotocol=https\n"> 
                  <"\t\thost=other.tld\n"> <"\t\t--\n"> <"\t\tprotocol=https\n"> <"\t\thost=other.tld\n"> <"\t\tusername=askpass-username\n"> 
                  <"\t\tpassword=askpass-password\n"> <"\t\t--\n"> <"\t\taskpass: Username for ">
                ) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <"https://other.tld">) 
                (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <":\n"> <"\t\taskpass: Password for ">) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) 
                (SQ <"https://askpass-username@other.tld">) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <":\n"> <"\t\tEOF\n"> <"\t">)
              }
            )
            (C {(test_expect_success)} 
              {(DQ ("helper (") ($ VSub_Name "$HELPER") (") requires matching username"))} 
              {
                (SQ <"\n"> <"\t\tcheck fill $HELPER <<-\\EOF\n"> <"\t\tprotocol=https\n"> 
                  <"\t\thost=example.com\n"> <"\t\tusername=other\n"> <"\t\t--\n"> <"\t\tprotocol=https\n"> <"\t\thost=example.com\n"> 
                  <"\t\tusername=other\n"> <"\t\tpassword=askpass-password\n"> <"\t\t--\n"> <"\t\taskpass: Password for ">
                ) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <"https://other@example.com">) 
                (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <":\n"> <"\t\tEOF\n"> <"\t">)
              }
            )
            (C {(test_expect_success)} 
              {(DQ ("helper (") ($ VSub_Name "$HELPER") (") requires matching path"))} 
              {
                (SQ <"\n"> <"\t\ttest_config credential.usehttppath true &&\n"> 
                  <"\t\tcheck approve $HELPER <<-\\EOF &&\n"> <"\t\tprotocol=http\n"> <"\t\thost=path.tld\n"> <"\t\tpath=foo.git\n"> <"\t\tusername=user\n"> 
                  <"\t\tpassword=pass\n"> <"\t\tEOF\n"> <"\t\tcheck fill $HELPER <<-\\EOF\n"> <"\t\tprotocol=http\n"> <"\t\thost=path.tld\n"> 
                  <"\t\tpath=bar.git\n"> <"\t\t--\n"> <"\t\tprotocol=http\n"> <"\t\thost=path.tld\n"> <"\t\tpath=bar.git\n"> 
                  <"\t\tusername=askpass-username\n"> <"\t\tpassword=askpass-password\n"> <"\t\t--\n"> <"\t\taskpass: Username for ">
                ) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <"http://path.tld/bar.git">) 
                (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <":\n"> <"\t\taskpass: Password for ">) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) 
                (SQ <"http://askpass-username@path.tld/bar.git">) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <":\n"> <"\t\tEOF\n"> <"\t">)
              }
            )
            (C {(test_expect_success)} {(DQ ("helper (") ($ VSub_Name "$HELPER") (") can forget host"))} 
              {
                (SQ <"\n"> <"\t\tcheck reject $HELPER <<-\\EOF &&\n"> <"\t\tprotocol=https\n"> 
                  <"\t\thost=example.com\n"> <"\t\tEOF\n"> <"\t\tcheck fill $HELPER <<-\\EOF\n"> <"\t\tprotocol=https\n"> <"\t\thost=example.com\n"> 
                  <"\t\t--\n"> <"\t\tprotocol=https\n"> <"\t\thost=example.com\n"> <"\t\tusername=askpass-username\n"> 
                  <"\t\tpassword=askpass-password\n"> <"\t\t--\n"> <"\t\taskpass: Username for ">
                ) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <"https://example.com">) 
                (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <":\n"> <"\t\taskpass: Password for ">) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) 
                (SQ <"https://askpass-username@example.com">) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <":\n"> <"\t\tEOF\n"> <"\t">)
              }
            )
            (C {(test_expect_success)} 
              {(DQ ("helper (") ($ VSub_Name "$HELPER") (") can store multiple users"))} 
              {
                (SQ <"\n"> <"\t\tcheck approve $HELPER <<-\\EOF &&\n"> <"\t\tprotocol=https\n"> 
                  <"\t\thost=example.com\n"> <"\t\tusername=user1\n"> <"\t\tpassword=pass1\n"> <"\t\tEOF\n"> 
                  <"\t\tcheck approve $HELPER <<-\\EOF &&\n"> <"\t\tprotocol=https\n"> <"\t\thost=example.com\n"> <"\t\tusername=user2\n"> <"\t\tpassword=pass2\n"> 
                  <"\t\tEOF\n"> <"\t\tcheck fill $HELPER <<-\\EOF &&\n"> <"\t\tprotocol=https\n"> <"\t\thost=example.com\n"> 
                  <"\t\tusername=user1\n"> <"\t\t--\n"> <"\t\tprotocol=https\n"> <"\t\thost=example.com\n"> <"\t\tusername=user1\n"> 
                  <"\t\tpassword=pass1\n"> <"\t\tEOF\n"> <"\t\tcheck fill $HELPER <<-\\EOF\n"> <"\t\tprotocol=https\n"> <"\t\thost=example.com\n"> 
                  <"\t\tusername=user2\n"> <"\t\t--\n"> <"\t\tprotocol=https\n"> <"\t\thost=example.com\n"> <"\t\tusername=user2\n"> 
                  <"\t\tpassword=pass2\n"> <"\t\tEOF\n"> <"\t">
                )
              }
            )
            (C {(test_expect_success)} {(DQ ("helper (") ($ VSub_Name "$HELPER") (") can forget user"))} 
              {
                (SQ <"\n"> <"\t\tcheck reject $HELPER <<-\\EOF &&\n"> <"\t\tprotocol=https\n"> 
                  <"\t\thost=example.com\n"> <"\t\tusername=user1\n"> <"\t\tEOF\n"> <"\t\tcheck fill $HELPER <<-\\EOF\n"> <"\t\tprotocol=https\n"> 
                  <"\t\thost=example.com\n"> <"\t\tusername=user1\n"> <"\t\t--\n"> <"\t\tprotocol=https\n"> <"\t\thost=example.com\n"> 
                  <"\t\tusername=user1\n"> <"\t\tpassword=askpass-password\n"> <"\t\t--\n"> <"\t\taskpass: Password for ">
                ) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <"https://user1@example.com">) 
                (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <":\n"> <"\t\tEOF\n"> <"\t">)
              }
            )
            (C {(test_expect_success)} 
              {(DQ ("helper (") ($ VSub_Name "$HELPER") (") remembers other user"))} 
              {
                (SQ <"\n"> <"\t\tcheck fill $HELPER <<-\\EOF\n"> <"\t\tprotocol=https\n"> 
                  <"\t\thost=example.com\n"> <"\t\tusername=user2\n"> <"\t\t--\n"> <"\t\tprotocol=https\n"> <"\t\thost=example.com\n"> 
                  <"\t\tusername=user2\n"> <"\t\tpassword=pass2\n"> <"\t\tEOF\n"> <"\t">
                )
              }
            )
          ]
          spids: [331]
        )
      spids: [327 330]
    )
    (FuncDef
      name: helper_test_timeout
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:HELPER)
                  op: Equal
                  rhs: {(DQ ($ VSub_Star "$*"))}
                  spids: [769]
                )
              ]
              spids: [769]
            )
            (C {(test_expect_success)} {(DQ ("helper (") ($ VSub_Name "$HELPER") (") times out"))} 
              {
                (SQ <"\n"> <"\t\tcheck approve \"$HELPER\" <<-\\EOF &&\n"> <"\t\tprotocol=https\n"> 
                  <"\t\thost=timeout.tld\n"> <"\t\tusername=user\n"> <"\t\tpassword=pass\n"> <"\t\tEOF\n"> <"\t\tsleep 2 &&\n"> 
                  <"\t\tcheck fill \"$HELPER\" <<-\\EOF\n"> <"\t\tprotocol=https\n"> <"\t\thost=timeout.tld\n"> <"\t\t--\n"> <"\t\tprotocol=https\n"> 
                  <"\t\thost=timeout.tld\n"> <"\t\tusername=askpass-username\n"> <"\t\tpassword=askpass-password\n"> <"\t\t--\n"> 
                  <"\t\taskpass: Username for ">
                ) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <"https://timeout.tld">) 
                (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <":\n"> <"\t\taskpass: Password for ">) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) 
                (SQ <"https://askpass-username@timeout.tld">) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <":\n"> <"\t\tEOF\n"> <"\t">)
              }
            )
          ]
          spids: [766]
        )
      spids: [762 765]
    )
    (SimpleCommand
      words: [{(write_script)} {(askpass)}]
      redirects: [
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {("echo >&2 askpass: $*\n") 
              ("what=$(echo $1 | cut -d\" \" -f1 | tr A-Z a-z | tr -cd a-z)\n") ("echo \"askpass-$what\"\n")
            }
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [831]
        )
      ]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:GIT_ASKPASS)
          op: Equal
          rhs: {(DQ ($ VSub_Name "$PWD") (/askpass))}
          spids: [835]
        )
      ]
      spids: [835]
    )
    (C {(export)} {(GIT_ASKPASS)})
  ]
)