(command.CommandList children: [ (command.FuncDef name: test_set_editor body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:FAKE_EDITOR) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (C {(export)} {(FAKE_EDITOR)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:EDITOR) op: Equal rhs: {(SQ <'"$FAKE_EDITOR"'>)} ) ] ) (C {(export)} {(EDITOR)}) ] ) ) (command.FuncDef name: test_set_index_version body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_INDEX_VERSION) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (C {(export)} {(GIT_INDEX_VERSION)}) ] ) ) (command.FuncDef name: test_decode_color body: (command.BraceGroup children: [ (C {(awk)} { (SQ <'\n'> <'\t\tfunction name(n) {\n'> <'\t\t\tif (n == 0) return "RESET";\n'> <'\t\t\tif (n == 1) return "BOLD";\n'> <'\t\t\tif (n == 30) return "BLACK";\n'> <'\t\t\tif (n == 31) return "RED";\n'> <'\t\t\tif (n == 32) return "GREEN";\n'> <'\t\t\tif (n == 33) return "YELLOW";\n'> <'\t\t\tif (n == 34) return "BLUE";\n'> <'\t\t\tif (n == 35) return "MAGENTA";\n'> <'\t\t\tif (n == 36) return "CYAN";\n'> <'\t\t\tif (n == 37) return "WHITE";\n'> <'\t\t\tif (n == 40) return "BLACK";\n'> <'\t\t\tif (n == 41) return "BRED";\n'> <'\t\t\tif (n == 42) return "BGREEN";\n'> <'\t\t\tif (n == 43) return "BYELLOW";\n'> <'\t\t\tif (n == 44) return "BBLUE";\n'> <'\t\t\tif (n == 45) return "BMAGENTA";\n'> <'\t\t\tif (n == 46) return "BCYAN";\n'> <'\t\t\tif (n == 47) return "BWHITE";\n'> <'\t\t}\n'> <'\t\t{\n'> <'\t\t\twhile (match($0, /\\033\\[[0-9;]*m/) != 0) {\n'> <'\t\t\t\tprintf "%s<", substr($0, 1, RSTART-1);\n'> <'\t\t\t\tcodes = substr($0, RSTART+2, RLENGTH-3);\n'> <'\t\t\t\tif (length(codes) == 0)\n'> <'\t\t\t\t\tprintf "%s", name(0)\n'> <'\t\t\t\telse {\n'> <'\t\t\t\t\tn = split(codes, ary, ";");\n'> <'\t\t\t\t\tsep = "";\n'> <'\t\t\t\t\tfor (i = 1; i <= n; i++) {\n'> <'\t\t\t\t\t\tprintf "%s%s", sep, name(ary[i]);\n'> <'\t\t\t\t\t\tsep = ";"\n'> <'\t\t\t\t\t}\n'> <'\t\t\t\t}\n'> <'\t\t\t\tprintf ">";\n'> < '\t\t\t\t$0 = substr($0, RSTART + RLENGTH, length($0) - RSTART - RLENGTH + 1);\n' > <'\t\t\t}\n'> <'\t\t\tprint\n'> <'\t\t}\n'> <'\t'> ) } ) ] ) ) (command.FuncDef name: lf_to_nul body: (command.BraceGroup children:[(C {(perl)} {(-pe)} {(SQ <'y/\\012/\\000/'>)})]) ) (command.FuncDef name: nul_to_q body: (command.BraceGroup children:[(C {(perl)} {(-pe)} {(SQ <'y/\\000/Q/'>)})]) ) (command.FuncDef name: q_to_nul body: (command.BraceGroup children:[(C {(perl)} {(-pe)} {(SQ <'y/Q/\\000/'>)})]) ) (command.FuncDef name: q_to_cr body: (command.BraceGroup children:[(C {(tr)} {(Q)} {(SQ <'\\015'>)})]) ) (command.FuncDef name: q_to_tab body: (command.BraceGroup children:[(C {(tr)} {(Q)} {(SQ <'\\011'>)})]) ) (command.FuncDef name: qz_to_tab_space body: (command.BraceGroup children:[(C {(tr)} {(QZ)} {(SQ <'\\011\\040'>)})]) ) (command.FuncDef name: append_cr body: (command.BraceGroup children: [ (command.Pipeline children: [(C {(sed)} {(-e)} {(SQ <'s/$/Q/'>)}) (C {(tr)} {(Q)} {(SQ <'\\015'>)})] negated: F ) ] ) ) (command.FuncDef name: remove_cr body: (command.BraceGroup children: [ (command.Pipeline children: [(C {(tr)} {(SQ <'\\015'>)} {(Q)}) (C {(sed)} {(-e)} {(SQ <'s/Q$//'>)})] negated: F ) ] ) ) (command.FuncDef name: sane_unset body: (command.BraceGroup children: [ (C {(unset)} {(DQ ($ VSub_At '$@'))}) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)}) ] ) ) (command.FuncDef name: test_tick body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (C {(test)} {(-z)} { (DQ (word_part.BracedVarSub token: <VSub_Name test_tick> suffix_op: (suffix_op.StringUnary op_id:VTest_Plus arg_word:{(set)}) ) ) } ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_tick) op: Equal rhs: {(1112911993)} ) ] ) ] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_tick) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{($ VSub_DollarName '$test_tick')}) right: (arith_expr.ArithWord w:{(Lit_Digits 60)}) ) ) } ) ] ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_COMMITTER_DATE) op: Equal rhs: {(DQ ($ VSub_DollarName '$test_tick') (' -0700'))} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_AUTHOR_DATE) op: Equal rhs: {(DQ ($ VSub_DollarName '$test_tick') (' -0700'))} ) ] ) (C {(export)} {(GIT_COMMITTER_DATE)} {(GIT_AUTHOR_DATE)}) ] ) ) (command.FuncDef name: test_pause body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(test)} {(DQ ($ VSub_DollarName '$verbose'))} {(Lit_Other '=')} {(t)}) terminator: <Op_Semi ';'> ) ] action: [ (command.SimpleCommand words: [{(DQ ($ VSub_DollarName '$SHELL_PATH'))}] redirects: [ (redir.Redir op: <Redir_LessAnd '<&'> fd: 16777215 arg_word: {(6)} ) (redir.Redir op: <Redir_GreatAnd '>&'> fd: 16777215 arg_word: {(3)} ) (redir.Redir op: <Redir_GreatAnd '2>&'> fd: 2 arg_word: {(4)} ) ] ) ] ) ] else_action: [ (command.SimpleCommand words: [{(error)} {(DQ ('test_pause requires --verbose'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(5)})] ) ] ) ] ) ) (command.FuncDef name: debug body: (command.BraceGroup children: [ (command.SimpleCommand words: [{(DQ ($ VSub_At '$@'))}] more_env: [(env_pair name:GIT_TEST_GDB val:{(1)})] ) ] ) ) (command.FuncDef name: test_commit body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:notick) op:Equal rhs:(word.EmptyWord))] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:signoff) op:Equal rhs:(word.EmptyWord))] ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(test)} {($ VSub_Pound '$#')} {(KW_Bang '!') (Lit_Other '=')} {(0)})] body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(--notick)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:notick) op: Equal rhs: {(yes)} ) ] ) ] ) (case_arm pat_list: [{(--signoff)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:signoff) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) ] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [(command.ControlFlow token:<ControlFlow_Break break>)] ) ] ) (C {(shift)}) ] ) ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:file) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Number 2> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonHyphen arg_word: {(DQ ($ VSub_Number '$1') (.t))} ) ) } ) ] ) (command.SimpleCommand words: [ {(echo)} { (DQ (word_part.BracedVarSub token: <VSub_Number 3> suffix_op: (suffix_op.StringUnary op_id: VTest_Hyphen arg_word: {($ VSub_Number '$1')} ) ) ) } ] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$file'))} ) ] ) (C {(git)} {(add)} {(DQ ($ VSub_DollarName '$file'))}) (command.If arms: [ (if_arm cond: [(C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$notick'))})] action: [(C {(test_tick)})] ) ] ) (C {(git)} {(commit)} {($ VSub_DollarName '$signoff')} {(-m)} {(DQ ($ VSub_Number '$1'))}) (C {(git)} {(tag)} { (DQ (word_part.BracedVarSub token: <VSub_Number 4> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonHyphen arg_word: {($ VSub_Number '$1')} ) ) ) } ) ] ) ] ) ) (command.FuncDef name: test_merge body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (C {(test_tick)}) (C {(git)} {(merge)} {(-m)} {(DQ ($ VSub_Number '$1'))} {(DQ ($ VSub_Number '$2'))}) (C {(git)} {(tag)} {(DQ ($ VSub_Number '$1'))}) ] ) ] ) ) (command.FuncDef name: test_chmod body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(chmod)} {(DQ ($ VSub_At '$@'))}) (C {(git)} {(update-index)} {(--add)} {(DQ ('--chmod=') ($ VSub_At '$@'))}) ] ) ] ) ) (command.FuncDef name: test_unconfig body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:config_dir) op:Equal rhs:(word.EmptyWord))] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(-C)})] action: [ (C {(shift)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:config_dir) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) (C {(shift)}) ] ) ] ) (C {(git)} { (word_part.BracedVarSub token: <VSub_Name config_dir> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonPlus arg_word: {('-C ') (DQ ($ VSub_DollarName '$config_dir'))} ) ) } {(config)} {(--unset-all)} {(DQ ($ VSub_At '$@'))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:config_status) op: Equal rhs: {($ VSub_QMark '$?')} ) ] ) (command.Case to_match: {(DQ ($ VSub_DollarName '$config_status'))} arms: [ (case_arm pat_list: [{(5)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:config_status) op: Equal rhs: {(0)} ) ] ) ] ) ] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {($ VSub_DollarName '$config_status')} ) ] ) ) (command.FuncDef name: test_config body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:config_dir) op:Equal rhs:(word.EmptyWord))] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(-C)})] action: [ (C {(shift)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:config_dir) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) (C {(shift)}) ] ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (C {(test_when_finished)} { (DQ ('test_unconfig ') (word_part.BracedVarSub token: <VSub_Name config_dir> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonPlus arg_word: {("-C '") ($ VSub_DollarName '$config_dir') ("'")} ) ) (" '") ($ VSub_Number '$1') ("'") ) } ) (C {(git)} { (word_part.BracedVarSub token: <VSub_Name config_dir> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonPlus arg_word: {('-C ') (DQ ($ VSub_DollarName '$config_dir'))} ) ) } {(config)} {(DQ ($ VSub_At '$@'))} ) ] ) ] ) ) (command.FuncDef name: test_config_global body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test_when_finished)} {(DQ ("test_unconfig --global '") ($ VSub_Number '$1') ("'"))}) (C {(git)} {(config)} {(--global)} {(DQ ($ VSub_At '$@'))}) ] ) ] ) ) (command.FuncDef name: write_script body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(echo)} { (DQ ('#!') (word_part.BracedVarSub token: <VSub_Number 2> suffix_op: (suffix_op.StringUnary op_id: VTest_Hyphen arg_word: {(DQ ($ VSub_DollarName '$SHELL_PATH'))} ) ) ) } ) (C {(cat)}) ] ) ] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$1'))} ) ] ) (C {(chmod)} {(Lit_Other '+') (x)} {(DQ ($ VSub_Number '$1'))}) ] ) ] ) ) (command.FuncDef name: test_set_prereq body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:satisfied_prereq) op: Equal rhs: {(DQ ($ VSub_DollarName '$satisfied_prereq') ($ VSub_Number '$1') (' '))} ) ] ) ] ) ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:satisfied_prereq) op:Equal rhs:{(DQ (' '))})] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs:(lhs_expr.LhsName name:lazily_testable_prereq) op:Equal rhs:(word.EmptyWord)) (assign_pair lhs:(lhs_expr.LhsName name:lazily_tested_prereq) op:Equal rhs:(word.EmptyWord)) ] ) (command.FuncDef name: test_lazy_prereq body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lazily_testable_prereq) op: Equal rhs: {(DQ ($ VSub_DollarName '$lazily_testable_prereq') ($ VSub_Number '$1') (' '))} ) ] ) (C {(eval)} {(test_prereq_lazily_) ($ VSub_Number '$1') (Lit_Other '=') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (2) } ) ] ) ) (command.FuncDef name: test_run_lazy_prereq_ body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:script) op: Equal rhs: { (SQ <'\n'> <'mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&\n'> <'(\n'> <'\tcd "$TRASH_DIRECTORY/prereq-test-dir" &&'> ) (DQ ($ VSub_Number '$2')) (SQ <'\n'> <')'>) } ) ] ) (command.SimpleCommand words: [{(say)} {(DQ ('checking prerequisite: ') ($ VSub_Number '$1'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(3)})] ) (command.SimpleCommand words: [{(say)} {(DQ ($ VSub_DollarName '$script'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(3)})] ) (C {(test_eval_)} {(DQ ($ VSub_DollarName '$script'))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:eval_ret) op: Equal rhs: {($ VSub_QMark '$?')} ) ] ) (C {(rm)} {(-rf)} {(DQ ($ VSub_DollarName '$TRASH_DIRECTORY') (/prereq-test-dir))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(test)} {(DQ ($ VSub_DollarName '$eval_ret'))} {(Lit_Other '=')} {(0)}) terminator: <Op_Semi ';'> ) ] action: [ (command.SimpleCommand words: [{(say)} {(DQ ('prerequisite ') ($ VSub_Number '$1') (' ok'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(3)})] ) ] ) ] else_action: [ (command.SimpleCommand words: [{(say)} {(DQ ('prerequisite ') ($ VSub_Number '$1') (' not satisfied'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(3)})] ) ] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {($ VSub_DollarName '$eval_ret')} ) ] ) ) (command.FuncDef name: test_have_prereq body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:save_IFS) op: Equal rhs: {($ VSub_DollarName '$IFS')} ) ] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:IFS) op:Equal rhs:{(Lit_Comma ',')})] ) (C {(set)} {(--)} {($ VSub_Star '$*')}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:IFS) op: Equal rhs: {($ VSub_DollarName '$save_IFS')} ) ] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:total_prereq) op:Equal rhs:{(0)})] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:ok_prereq) op:Equal rhs:{(0)})] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:missing_prereq) op:Equal rhs:(word.EmptyWord))] ) (command.ForEach iter_name: prerequisite do_arg_iter: T body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ VSub_DollarName '$prerequisite'))} arms: [ (case_arm pat_list: [{(KW_Bang '!') (Lit_Other '*')}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:negative_prereq) op: Equal rhs: {(t)} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:prerequisite) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name prerequisite> suffix_op: (suffix_op.StringUnary op_id: VOp1_Pound arg_word: {('!')} ) ) } ) ] ) ] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:negative_prereq) op: Equal rhs: (word.EmptyWord) ) ] ) ] ) ] ) (command.Case to_match: {(DQ (' ') ($ VSub_DollarName '$lazily_tested_prereq') (' '))} arms: [ (case_arm pat_list: [ {(Lit_Other '*') (DQ (' ') ($ VSub_DollarName '$prerequisite') (' ')) (Lit_Other '*') } ] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.Case to_match: {(DQ (' ') ($ VSub_DollarName '$lazily_testable_prereq') (' '))} arms: [ (case_arm pat_list: [ {(Lit_Other '*') (DQ (' ') ($ VSub_DollarName '$prerequisite') (' ')) (Lit_Other '*') } ] action: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(eval)} { (DQ ('script=') (word_part.EscapedLiteralPart token: <Lit_EscapedChar '\\$'> ) (test_prereq_lazily_) ($ VSub_DollarName '$prerequisite') ) } ) (command.If arms: [ (if_arm cond: [ (C {(test_run_lazy_prereq_)} {(DQ ($ VSub_DollarName '$prerequisite'))} {(DQ ($ VSub_DollarName '$script'))} ) ] action: [ (C {(test_set_prereq)} {($ VSub_DollarName '$prerequisite')} ) ] ) ] ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lazily_tested_prereq) op: Equal rhs: { (DQ ($ VSub_DollarName '$lazily_tested_prereq') ($ VSub_DollarName '$prerequisite') (' ') ) } ) ] ) ] ) ] ) ] ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:total_prereq) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_DollarName '$total_prereq')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) } ) ] ) (command.Case to_match: {(DQ ($ VSub_DollarName '$satisfied_prereq'))} arms: [ (case_arm pat_list: [ {(Lit_Other '*') (DQ (' ') ($ VSub_DollarName '$prerequisite') (' ')) (Lit_Other '*') } ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:satisfied_this_prereq) op: Equal rhs: {(t)} ) ] ) ] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:satisfied_this_prereq) op: Equal rhs: (word.EmptyWord) ) ] ) ] ) ] ) (command.Case to_match: { (DQ ($ VSub_DollarName '$satisfied_this_prereq') (',') ($ VSub_DollarName '$negative_prereq') ) } arms: [ (case_arm pat_list: [{(t) (Lit_Comma ',')} {(Lit_Comma ',') (t)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ok_prereq) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_DollarName '$ok_prereq')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) } ) ] ) ] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:prerequisite) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name negative_prereq> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonPlus arg_word: {('!')} ) ) ($ VSub_DollarName '$prerequisite') } ) ] ) (command.If arms: [ (if_arm cond: [ (C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$missing_prereq'))}) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:missing_prereq) op: Equal rhs: {($ VSub_DollarName '$prerequisite')} ) ] ) ] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:missing_prereq) op: Equal rhs: { (DQ ($ VSub_DollarName '$prerequisite') (',') ($ VSub_DollarName '$missing_prereq') ) } ) ] ) ] ) ] ) ] ) ] ) ) (C {(test)} {($ VSub_DollarName '$total_prereq')} {(Lit_Other '=')} {($ VSub_DollarName '$ok_prereq')} ) ] ) ) (command.FuncDef name: test_declared_prereq body: (command.BraceGroup children: [ (command.Case to_match: {(DQ (',') ($ VSub_DollarName '$test_prereq') (','))} arms: [ (case_arm pat_list: [ {(Lit_Other '*') (Lit_Comma ',') ($ VSub_Number '$1') (Lit_Comma ',') (Lit_Other '*') } ] action: [(command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] ) ] ) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) ) (command.FuncDef name: test_verify_prereq body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DPipe Op_DPipe] children: [ (C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$test_prereq'))}) (command.SimpleCommand words: [ {(expr)} {(DQ ($ VSub_DollarName '$test_prereq'))} {(Lit_Other ':')} {(SQ <'[A-Z0-9_,!]*$'>)} ] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})] ) (C {(error)} { (DQ ("bug in the test script: '") ($ VSub_DollarName '$test_prereq') ("' does not look like a prereq") ) } ) ] ) ] ) ) (command.FuncDef name: test_expect_failure body: (command.BraceGroup children: [ (C {(test_start_)}) (command.AndOr ops: [Op_DAmp Op_DPipe] children: [ (C {(test)} {(DQ ($ VSub_Pound '$#'))} {(Lit_Other '=')} {(3)}) (command.BraceGroup children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_prereq) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(shift)}) terminator: <Op_Semi ';'> ) ] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:test_prereq) op:Equal rhs:(word.EmptyWord))] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(DQ ($ VSub_Pound '$#'))} {(Lit_Other '=')} {(2)}) (C {(error)} {(DQ ('bug in the test script: not 2 or 3 parameters to test-expect-failure'))} ) ] ) (C {(test_verify_prereq)}) (C {(export)} {(test_prereq)}) (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [(C {(test_skip)} {(DQ ($ VSub_At '$@'))})] negated: T ) ] action: [ (command.SimpleCommand words: [{(say)} {(DQ ('checking known breakage: ') ($ VSub_Number '$2'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(3)})] ) (command.If arms: [ (if_arm cond: [(C {(test_run_)} {(DQ ($ VSub_Number '$2'))} {(expecting_failure)})] action: [(C {(test_known_broken_ok_)} {(DQ ($ VSub_Number '$1'))})] ) ] else_action: [(C {(test_known_broken_failure_)} {(DQ ($ VSub_Number '$1'))})] ) ] ) ] ) (C {(test_finish_)}) ] ) ) (command.FuncDef name: test_expect_success body: (command.BraceGroup children: [ (C {(test_start_)}) (command.AndOr ops: [Op_DAmp Op_DPipe] children: [ (C {(test)} {(DQ ($ VSub_Pound '$#'))} {(Lit_Other '=')} {(3)}) (command.BraceGroup children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_prereq) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(shift)}) terminator: <Op_Semi ';'> ) ] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:test_prereq) op:Equal rhs:(word.EmptyWord))] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(DQ ($ VSub_Pound '$#'))} {(Lit_Other '=')} {(2)}) (C {(error)} {(DQ ('bug in the test script: not 2 or 3 parameters to test-expect-success'))} ) ] ) (C {(test_verify_prereq)}) (C {(export)} {(test_prereq)}) (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [(C {(test_skip)} {(DQ ($ VSub_At '$@'))})] negated: T ) ] action: [ (command.SimpleCommand words: [{(say)} {(DQ ('expecting success: ') ($ VSub_Number '$2'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(3)})] ) (command.If arms: [ (if_arm cond: [(C {(test_run_)} {(DQ ($ VSub_Number '$2'))})] action: [(C {(test_ok_)} {(DQ ($ VSub_Number '$1'))})] ) ] else_action: [(C {(test_failure_)} {(DQ ($ VSub_At '$@'))})] ) ] ) ] ) (C {(test_finish_)}) ] ) ) (command.FuncDef name: test_external body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DPipe] children: [ (C {(test)} {(DQ ($ VSub_Pound '$#'))} {(Lit_Other '=')} {(4)}) (command.BraceGroup children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_prereq) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(shift)}) terminator: <Op_Semi ';'> ) ] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:test_prereq) op:Equal rhs:(word.EmptyWord))] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(DQ ($ VSub_Pound '$#'))} {(Lit_Other '=')} {(3)}) (command.SimpleCommand words: [ {(error)} {(DQ ('bug in the test script: not 3 or 4 parameters to test_external'))} ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(5)})] ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:descr) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (C {(shift)}) (C {(test_verify_prereq)}) (C {(export)} {(test_prereq)}) (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [ (C {(test_skip)} {(DQ ($ VSub_DollarName '$descr'))} {(DQ ($ VSub_At '$@'))}) ] negated: T ) ] action: [ (C {(say_color)} {(DQ )} { (DQ ('# run ') ($ VSub_DollarName '$test_count') (': ') ($ VSub_DollarName '$descr') (' (') ($ VSub_Star '$*') (')') ) } ) (C {(export)} {(TEST_DIRECTORY)} {(TRASH_DIRECTORY)} {(GIT_TEST_LONG)}) (command.SimpleCommand words: [{(DQ ($ VSub_At '$@'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(4)})] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(DQ ($ VSub_QMark '$?'))} {(Lit_Other '=')} {(0)})] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(test)} {($ VSub_DollarName '$test_external_has_tap')} {(-eq)} {(0)} ) terminator: <Op_Semi ';'> ) ] action: [(C {(test_ok_)} {(DQ ($ VSub_DollarName '$descr'))})] ) ] else_action: [ (C {(say_color)} {(DQ )} { (DQ ('# test_external test ') ($ VSub_DollarName '$descr') (' was ok') ) } ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_success) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_DollarName '$test_success')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) } ) ] ) ] ) ] ) ] else_action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(test)} {($ VSub_DollarName '$test_external_has_tap')} {(-eq)} {(0)} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(test_failure_)} {(DQ ($ VSub_DollarName '$descr'))} {(DQ ($ VSub_At '$@'))} ) ] ) ] else_action: [ (C {(say_color)} {(error)} { (DQ ('# test_external test ') ($ VSub_DollarName '$descr') (' failed: ') ($ VSub_At '$@') ) } ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_failure) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_DollarName '$test_failure')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) } ) ] ) ] ) ] ) ] ) ] ) ] ) ) (command.FuncDef name: test_external_without_stderr body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tmp) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name TMPDIR> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonHyphen arg_word: {(Lit_Slash /) (tmp)} ) ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:stderr) op: Equal rhs: { (DQ ($ VSub_DollarName '$tmp') (/git-external-stderr.) ($ VSub_Dollar '$$') (.tmp)) } ) ] ) (command.SimpleCommand words: [{(test_external)} {(DQ ($ VSub_At '$@'))}] redirects: [ (redir.Redir op: <Redir_Great '4>'> fd: 4 arg_word: {(DQ ($ VSub_DollarName '$stderr'))} ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(-f)} {(DQ ($ VSub_DollarName '$stderr'))}) (C {(error)} {(DQ ('Internal error: ') ($ VSub_DollarName '$stderr') (' disappeared.'))}) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:descr) op: Equal rhs: {(DQ ('no stderr: ') ($ VSub_Number '$1'))} ) ] ) (C {(shift)}) (command.SimpleCommand words: [{(say)} {(DQ ('# expecting no stderr from previous command'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(3)})] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(KW_Bang '!')} {(-s)} {(DQ ($ VSub_DollarName '$stderr'))})] action: [ (C {(rm)} {(DQ ($ VSub_DollarName '$stderr'))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(test)} {($ VSub_DollarName '$test_external_has_tap')} {(-eq)} {(0)}) terminator: <Op_Semi ';'> ) ] action: [(C {(test_ok_)} {(DQ ($ VSub_DollarName '$descr'))})] ) ] else_action: [ (C {(say_color)} {(DQ )} { (DQ ('# test_external_without_stderr test ') ($ VSub_DollarName '$descr') (' was ok') ) } ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_success) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_DollarName '$test_success')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) } ) ] ) ] ) ] ) ] else_action: [ (command.If arms: [ (if_arm cond: [(C {(test)} {(DQ ($ VSub_DollarName '$verbose'))} {(Lit_Other '=')} {(t)})] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:output) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Sentence child: (C {(echo)}) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(echo)} {(DQ ('# Stderr is:'))}) terminator: <Op_Semi ';'> ) (C {(cat)} {(DQ ($ VSub_DollarName '$stderr'))}) ] ) left_token: <Left_CommandSub '$('> ) } ) ] ) ] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:output) op:Equal rhs:(word.EmptyWord))] ) ] ) (C {(rm)} {(DQ ($ VSub_DollarName '$stderr'))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(test)} {($ VSub_DollarName '$test_external_has_tap')} {(-eq)} {(0)}) terminator: <Op_Semi ';'> ) ] action: [ (C {(test_failure_)} {(DQ ($ VSub_DollarName '$descr'))} {(DQ ($ VSub_At '$@'))} {(DQ ($ VSub_DollarName '$output'))} ) ] ) ] else_action: [ (C {(say_color)} {(error)} { (DQ ('# test_external_without_stderr test ') ($ VSub_DollarName '$descr') (' failed: ') ($ VSub_At '$@') (': ') ($ VSub_DollarName '$output') ) } ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_failure) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_DollarName '$test_failure')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) } ) ] ) ] ) ] ) ] ) ) (command.FuncDef name: test_path_is_file body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [(C {(test)} {(-f)} {(DQ ($ VSub_Number '$1'))})] negated: T ) ] action: [ (C {(echo)} {(DQ ('File ') ($ VSub_Number '$1') (" doesn't exist. ") ($ VSub_Number '$2'))} ) (C {(false)}) ] ) ] ) ] ) ) (command.FuncDef name: test_path_is_dir body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [(C {(test)} {(-d)} {(DQ ($ VSub_Number '$1'))})] negated: T ) ] action: [ (C {(echo)} { (DQ ('Directory ') ($ VSub_Number '$1') (" doesn't exist. ") ($ VSub_Number '$2') ) } ) (C {(false)}) ] ) ] ) ] ) ) (command.FuncDef name: test_dir_is_empty body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test_path_is_dir)} {(DQ ($ VSub_Number '$1'))}) (command.If arms: [ (if_arm cond: [ (C {(test)} {(-n)} { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(ls)} {(-a1)} {(DQ ($ VSub_Number '$1'))}) (C {(egrep)} {(-v)} {(SQ <'^\\.\\.?$'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> ) ) } ) ] action: [ (C {(echo)} {(DQ ("Directory '") ($ VSub_Number '$1') ("' is not empty, it contains:"))} ) (C {(ls)} {(-la)} {(DQ ($ VSub_Number '$1'))}) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) ] ) ] ) ] ) ) (command.FuncDef name: test_path_is_missing body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [(C {(test)} {(-e)} {(DQ ($ VSub_Number '$1'))})] action: [ (C {(echo)} {(DQ ('Path exists:'))}) (C {(ls)} {(-ld)} {(DQ ($ VSub_Number '$1'))}) (command.If arms: [ (if_arm cond: [(C {(test)} {($ VSub_Pound '$#')} {(-ge)} {(1)})] action: [(C {(echo)} {(DQ ($ VSub_Star '$*'))})] ) ] ) (C {(false)}) ] ) ] ) ] ) ) (command.FuncDef name: test_line_count body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [(C {(test)} {($ VSub_Pound '$#')} {(KW_Bang '!') (Lit_Other '=')} {(3)})] action: [ (C {(error)} {(DQ ('bug in the test script: not 3 parameters to test_line_count'))}) ] ) (if_arm cond: [ (command.Pipeline children: [ (C {(test)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.SimpleCommand words: [{(wc)} {(-l)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$3'))} ) ] ) ] ) left_token: <Left_CommandSub '$('> ) } {(DQ ($ VSub_Number '$1'))} {(DQ ($ VSub_Number '$2'))} ) ] negated: T ) ] action: [ (C {(echo)} { (DQ ('test_line_count: line count for ') ($ VSub_Number '$3') (' !') ($ VSub_Number '$1') (' ') ($ VSub_Number '$2') ) } ) (C {(cat)} {(DQ ($ VSub_Number '$3'))}) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) ] ) ] ) ) (command.FuncDef name: list_contains body: (command.BraceGroup children: [ (command.Case to_match: {(DQ (',') ($ VSub_Number '$1') (','))} arms: [ (case_arm pat_list: [ {(Lit_Other '*') (Lit_Comma ',') ($ VSub_Number '$2') (Lit_Comma ',') (Lit_Other '*') } ] action: [(command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] ) ] ) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) ) (command.FuncDef name: test_must_fail body: (command.BraceGroup children: [ (command.Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(Lit_VarLike 'ok=') (Lit_Other '*')}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:_test_ok) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Number 1> suffix_op: (suffix_op.StringUnary op_id:VOp1_Pound arg_word:{('ok=')}) ) } ) ] ) (C {(shift)}) ] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:_test_ok) op:Equal rhs:(word.EmptyWord))] ) ] ) ] ) (C {(DQ ($ VSub_At '$@'))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:exit_code) op: Equal rhs: {($ VSub_QMark '$?')} ) ] ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {($ VSub_DollarName '$exit_code')} {(-eq)} {(0)}) (command.Pipeline children: [ (C {(list_contains)} {(DQ ($ VSub_DollarName '$_test_ok'))} {(success)}) ] negated: T ) ] ) ] action: [ (command.SimpleCommand words: [{(echo)} {(DQ ('test_must_fail: command succeeded: ') ($ VSub_Star '$*'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) (if_arm cond: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test_match_signal)} {(13)} {($ VSub_DollarName '$exit_code')}) (C {(list_contains)} {(DQ ($ VSub_DollarName '$_test_ok'))} {(sigpipe)}) ] ) ] action: [(command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] ) (if_arm cond: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {($ VSub_DollarName '$exit_code')} {(-gt)} {(129)}) (C {(test)} {($ VSub_DollarName '$exit_code')} {(-le)} {(192)}) ] ) ] action: [ (command.SimpleCommand words: [ {(echo)} { (DQ ('test_must_fail: died by signal ') (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w:{($ VSub_DollarName '$exit_code')}) right: (arith_expr.ArithWord w:{(Lit_Digits 128)}) ) ) (': ') ($ VSub_Star '$*') ) } ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) (if_arm cond: [(C {(test)} {($ VSub_DollarName '$exit_code')} {(-eq)} {(127)})] action: [ (command.SimpleCommand words: [{(echo)} {(DQ ('test_must_fail: command not found: ') ($ VSub_Star '$*'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) (if_arm cond: [(C {(test)} {($ VSub_DollarName '$exit_code')} {(-eq)} {(126)})] action: [ (command.SimpleCommand words: [{(echo)} {(DQ ('test_must_fail: valgrind error: ') ($ VSub_Star '$*'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) ] ) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)}) ] ) ) (command.FuncDef name: test_might_fail body: (command.BraceGroup children: [(C {(test_must_fail)} {(Lit_VarLike 'ok=') (success)} {(DQ ($ VSub_At '$@'))})] ) ) (command.FuncDef name: test_expect_code body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:want_code) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) (C {(shift)}) (C {(DQ ($ VSub_At '$@'))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:exit_code) op: Equal rhs: {($ VSub_QMark '$?')} ) ] ) (command.If arms: [ (if_arm cond: [ (C {(test)} {($ VSub_DollarName '$exit_code')} {(Lit_Other '=')} {($ VSub_DollarName '$want_code')} ) ] action: [(command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] ) ] ) (command.SimpleCommand words: [ {(echo)} { (DQ ('test_expect_code: command exited with ') ($ VSub_DollarName '$exit_code') (', we wanted ') ($ VSub_DollarName '$want_code') (' ') ($ VSub_Star '$*') ) } ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) ) (command.FuncDef name: test_cmp body: (command.BraceGroup children: [(C {($ VSub_DollarName '$GIT_TEST_CMP')} {(DQ ($ VSub_At '$@'))})] ) ) (command.FuncDef name: test_cmp_bin body: (command.BraceGroup children:[(C {(cmp)} {(DQ ($ VSub_At '$@'))})]) ) (command.FuncDef name: verbose body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(DQ ($ VSub_At '$@'))}) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)}) ] ) (command.SimpleCommand words: [ {(echo)} { (DQ ('command failed: ') (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(--sq-quote)} {(DQ ($ VSub_At '$@'))})] ) left_token: <Left_CommandSub '$('> ) ) } ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) ) (command.FuncDef name: test_must_be_empty body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [(C {(test)} {(-s)} {(DQ ($ VSub_Number '$1'))})] action: [ (C {(echo)} {(DQ ("'") ($ VSub_Number '$1') ("' is not empty, it contains:"))}) (C {(cat)} {(DQ ($ VSub_Number '$1'))}) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) ] ) ] ) ) (command.FuncDef name: test_cmp_rev body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (command.SimpleCommand words: [{(git)} {(rev-parse)} {(--verify)} {(DQ ($ VSub_Number '$1'))}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect.rev)})] ) (command.SimpleCommand words: [{(git)} {(rev-parse)} {(--verify)} {(DQ ($ VSub_Number '$2'))}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(actual.rev)})] ) (C {(test_cmp)} {(expect.rev)} {(actual.rev)}) ] ) ] ) ) (command.FuncDef name: test_seq body: (command.BraceGroup children: [ (command.Case to_match: {($ VSub_Pound '$#')} arms: [ (case_arm pat_list: [{(1)}] action: [(C {(set)} {(1)} {(DQ ($ VSub_At '$@'))})] ) (case_arm pat_list:[{(2)}]) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (C {(error)} {(DQ ('bug in the test script: not 1 or 2 parameters to test_seq'))}) ] ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_seq_counter__) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) (command.WhileUntil keyword: <KW_While while> cond: [ (C {(test)} {(DQ ($ VSub_DollarName '$test_seq_counter__'))} {(-le)} {(DQ ($ VSub_Number '$2'))} ) ] body: (command.DoGroup children: [ (C {(echo)} {(DQ ($ VSub_DollarName '$test_seq_counter__'))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_seq_counter__) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_DollarName '$test_seq_counter__')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) } ) ] ) ] ) ) ] ) ) (command.FuncDef name: test_when_finished body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} { (DQ (word_part.BracedVarSub token: <VSub_Name BASH_SUBSHELL> suffix_op: (suffix_op.StringUnary op_id:VTest_Hyphen arg_word:{(0)}) ) ) } {(Lit_Other '=')} {(0)} ) (C {(error)} {(DQ ('bug in test script: test_when_finished does nothing in a subshell'))} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_cleanup) op: Equal rhs: { (DQ ('{ ') ($ VSub_Star '$*') ('\n') ('\t\t} && (exit ') (word_part.EscapedLiteralPart token: <Lit_EscapedChar '\\"'> ) (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (eval_ret) (word_part.EscapedLiteralPart token: <Lit_EscapedChar '\\"'> ) ('); eval_ret=') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('?; ') ($ VSub_DollarName '$test_cleanup') ) } ) ] ) ] ) ) (command.FuncDef name: test_create_repo body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(DQ ($ VSub_Pound '$#'))} {(Lit_Other '=')} {(1)}) (C {(error)} {(DQ ('bug in the test script: not 1 parameter to test-create-repo'))}) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:repo) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (C {(mkdir)} {(-p)} {(DQ ($ VSub_DollarName '$repo'))}) (command.AndOr ops: [Op_DPipe] children: [ (command.Subshell command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DPipe] children: [ (C {(cd)} {(DQ ($ VSub_DollarName '$repo'))}) (C {(error)} {(DQ ('Cannot setup test environment'))}) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand words: [ {(DQ ($ VSub_DollarName '$GIT_EXEC_PATH') (/git-init))} { (DQ ('--template=') ($ VSub_DollarName '$GIT_BUILD_DIR') (/templates/blt/) ) } ] redirects: [ (redir.Redir op: <Redir_GreatAnd '>&'> fd: 16777215 arg_word: {(3)} ) (redir.Redir op: <Redir_GreatAnd '2>&'> fd: 2 arg_word: {(4)} ) ] ) (C {(error)} {(DQ ('cannot run git init -- have you built things yet?'))}) ] ) (C {(mv)} {(.git/hooks)} {(.git/hooks-disabled)}) ] ) ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) ] ) ) (command.FuncDef name: test_ln_s_add body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [(C {(test_have_prereq)} {(SYMLINKS)})] action: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(ln)} {(-s)} {(DQ ($ VSub_Number '$1'))} {(DQ ($ VSub_Number '$2'))}) (C {(git)} {(update-index)} {(--add)} {(DQ ($ VSub_Number '$2'))}) ] ) ] ) ] else_action: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (command.SimpleCommand words: [{(printf)} {(SQ <'%s'>)} {(DQ ($ VSub_Number '$1'))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$2'))} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ln_s_obj) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(hash-object)} {(-w)} {(DQ ($ VSub_Number '$2'))}) ] ) left_token: <Left_CommandSub '$('> ) } ) ] ) (C {(git)} {(update-index)} {(--add)} {(--cacheinfo)} {(120000)} {($ VSub_DollarName '$ln_s_obj')} {(DQ ($ VSub_Number '$2'))} ) (C {(git)} {(update-index)} {(DQ ($ VSub_Number '$2'))}) ] ) ] ) ] ) ) (command.FuncDef name: test_write_lines body: (command.BraceGroup children: [(C {(printf)} {(DQ ('%s') (Lit_Other '\\') (n))} {(DQ ($ VSub_At '$@'))})] ) ) (command.FuncDef name: perl body: (command.BraceGroup children: [(C {(command)} {(DQ ($ VSub_DollarName '$PERL_PATH'))} {(DQ ($ VSub_At '$@'))})] ) ) (command.FuncDef name: test_normalize_bool body: (command.BraceGroup children: [ (command.SimpleCommand words: [ {(git)} {(-c)} {(magic.variable) (Lit_Other '=') (DQ ($ VSub_Number '$1'))} {(config)} {(--bool)} {(magic.variable)} ] redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})] ) ] ) ) (command.FuncDef name: test_tristate body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (C {(eval)} { (DQ ('test x') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (word_part.EscapedLiteralPart token: <Lit_EscapedChar '\\$'> ) ('{') ($ VSub_Number '$1') ('+isset}') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (' = xisset') ) } ) ] action: [ (C {(eval)} { (DQ ('\n') ('\t\t\tcase ') (word_part.EscapedLiteralPart token: <Lit_EscapedChar '\\"'> ) (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ($ VSub_Number '$1') (word_part.EscapedLiteralPart token: <Lit_EscapedChar '\\"'> ) (' in\n') ("\t\t\t'')\t") ($ VSub_Number '$1') ('=false ;;\n') ('\t\t\tauto)\t;;\n') ('\t\t\t*)\t') ($ VSub_Number '$1') ('=') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('(test_normalize_bool ') (word_part.EscapedLiteralPart token: <Lit_EscapedChar '\\$'> ) ($ VSub_Number '$1') (' || echo true) ;;\n') ('\t\t\tesac\n') ('\t\t') ) } ) ] ) ] else_action: [(C {(eval)} {(DQ ($ VSub_Number '$1') ('=auto'))})] ) ] ) ) (command.FuncDef name: test_skip_or_die body: (command.BraceGroup children: [ (command.Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(auto)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:skip_all) op: Equal rhs: {($ VSub_Number '$2')} ) ] ) (C {(test_done)}) ] ) (case_arm pat_list: [{(true)}] action: [(C {(error)} {(DQ ($ VSub_Number '$2'))})] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (C {(error)} { (DQ ("BUG: test tristate is '") ($ VSub_Number '$1') ("' (real error: ") ($ VSub_Number '$2') (')') ) } ) ] ) ] ) ] ) ) (command.FuncDef name: mingw_test_cmp body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Local pairs: [ (assign_pair lhs:(lhs_expr.LhsName name:test_cmp_a) op:Equal rhs:(word.EmptyWord)) (assign_pair lhs:(lhs_expr.LhsName name:test_cmp_b) op:Equal rhs:(word.EmptyWord)) ] ) (command.Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(lhs_expr.LhsName name:stdin_for_diff) op:Equal rhs:(word.EmptyWord))] ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {(-s)} {(DQ ($ VSub_Number '$1'))}) (C {(test)} {(-s)} {(DQ ($ VSub_Number '$2'))}) ] ) ] action: [ (command.SimpleCommand words: [{(mingw_read_file_strip_cr_)} {(test_cmp_a)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$1'))} ) ] ) (command.SimpleCommand words: [{(mingw_read_file_strip_cr_)} {(test_cmp_b)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$2'))} ) ] ) ] ) (if_arm cond: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {(-s)} {(DQ ($ VSub_Number '$1'))}) (C {(test)} {(DQ ($ VSub_Number '$2'))} {(Lit_Other '=')} {(-)}) ] ) ] action: [ (command.SimpleCommand words: [{(mingw_read_file_strip_cr_)} {(test_cmp_a)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$1'))} ) ] ) (C {(mingw_read_file_strip_cr_)} {(test_cmp_b)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:stdin_for_diff) op: Equal rhs: {(SQ <'<<<"$test_cmp_b"'>)} ) ] ) ] ) (if_arm cond: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(-)}) (C {(test)} {(-s)} {(DQ ($ VSub_Number '$2'))}) ] ) ] action: [ (C {(mingw_read_file_strip_cr_)} {(test_cmp_a)}) (command.SimpleCommand words: [{(mingw_read_file_strip_cr_)} {(test_cmp_b)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$2'))} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:stdin_for_diff) op: Equal rhs: {(SQ <'<<<"$test_cmp_a"'>)} ) ] ) ] ) ] ) (command.AndOr ops: [Op_DAmp Op_DAmp Op_DPipe] children: [ (C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$test_cmp_a'))}) (C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$test_cmp_b'))}) (C {(test)} {(DQ ($ VSub_DollarName '$test_cmp_a'))} {(Lit_Other '=')} {(DQ ($ VSub_DollarName '$test_cmp_b'))} ) (C {(eval)} { (DQ ('diff -u ') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (word_part.EscapedLiteralPart token: <Lit_EscapedChar '\\$'> ) ('@') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (' ') ($ VSub_DollarName '$stdin_for_diff') ) } ) ] ) ] ) ) (command.FuncDef name: mingw_read_file_strip_cr_ body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(lhs_expr.LhsName name:line) op:Equal)] ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(Lit_Other ':')})] body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.SimpleCommand words: [ {(read)} {(-r)} {(-d)} { (word_part.SingleQuotedPart left: <Left_DollarSingleQuote "$'"> tokens: [<Char_OneChar '\\n'>] ) } {(line)} ] more_env: [ (env_pair name: IFS val: { (word_part.SingleQuotedPart left: <Left_DollarSingleQuote "$'"> tokens: [<Char_OneChar '\\r'>] ) } ) ] ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:line) op: Equal rhs: {($ VSub_DollarName '$line') (word_part.SingleQuotedPart left: <Left_DollarSingleQuote "$'"> tokens: [<Char_OneChar '\\n'>] ) } ) ] ) ] ) ] else_action: [ (command.If arms: [ (if_arm cond: [(C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$line'))})] action: [(command.ControlFlow token:<ControlFlow_Break break>)] ) ] ) ] ) (C {(eval)} { (DQ ($ VSub_Number '$1') ('=') (word_part.EscapedLiteralPart token: <Lit_EscapedChar '\\$'> ) ($ VSub_Number '$1') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (line) ) } ) ] ) ) ] ) ) (command.FuncDef name: test_env body: (command.BraceGroup children: [ (command.Subshell command_list: (command.CommandList children: [ (command.WhileUntil keyword: <KW_While while> cond: [(C {(test)} {($ VSub_Pound '$#')} {(-gt)} {(0)})] body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(Lit_Other '*') (Lit_Other '=') (Lit_Other '*')}] action: [ (C {(eval)} { (DQ (word_part.BracedVarSub token: <VSub_Number 1> suffix_op: (suffix_op.StringUnary op_id: VOp1_DPercent arg_word: {('=*')} ) ) ('=') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('{1#*=}') ) } ) (C {(eval)} { (DQ ('export ') (word_part.BracedVarSub token: <VSub_Number 1> suffix_op: (suffix_op.StringUnary op_id: VOp1_DPercent arg_word: {('=*')} ) ) ) } ) (C {(shift)}) ] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (C {(DQ ($ VSub_At '$@'))}) (command.ControlFlow token: <ControlFlow_Exit exit> ) ] ) ] ) ] ) ) ] ) ) ] ) ) (command.FuncDef name: test_match_signal body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ VSub_Number '$2'))} {(Lit_Other '=')} { (DQ (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 128)}) right: (arith_expr.ArithWord w:{($ VSub_Number '$1')}) ) ) ) } ) ] action: [(command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] ) (if_arm cond: [ (C {(test)} {(DQ ($ VSub_Number '$2'))} {(Lit_Other '=')} { (DQ (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 256)}) right: (arith_expr.ArithWord w:{($ VSub_Number '$1')}) ) ) ) } ) ] action: [(command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] ) ] ) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) ) (command.FuncDef name: test_copy_bytes body: (command.BraceGroup children: [ (C {(perl)} {(-e)} { (SQ <'\n'> <'\t\tmy $len = $ARGV[1];\n'> <'\t\twhile ($len > 0) {\n'> <'\t\t\tmy $s;\n'> <'\t\t\tmy $nread = sysread(STDIN, $s, $len);\n'> <'\t\t\tdie "cannot read: $!" unless defined($nread);\n'> <'\t\t\tprint $s;\n'> <'\t\t\t$len -= $nread;\n'> <'\t\t}\n'> <'\t'> ) } {(-)} {(DQ ($ VSub_Number '$1'))} ) ] ) ) ] )