(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description spids:[12]) op: Equal rhs: {(SQ <'git rebase - test patch id computation'>)} spids: [12] ) ] spids: [12] ) (C {(.)} {(./test-lib.sh)}) (command.FuncDef name: count body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:i spids:[31]) op: Equal rhs: {(0)} spids: [31] ) ] spids: [31] ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(test)} {($ VSub_Name '$i')} {(-lt)} {($ VSub_Number '$1')})] body: (command.DoGroup children: [ (C {(echo)} {(DQ ($ VSub_Name '$i'))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:i spids:[56]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{($ VSub_Name '$i')}) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) spids: [57 62] ) } spids: [56] ) ] spids: [56] ) ] spids: [46 65] ) ) ] spids: [28] ) spids: [23 27] ) (command.FuncDef name: scramble body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:i spids:[78]) op: Equal rhs: {(0)} spids: [78] ) ] spids: [78] ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(read)} {(x)})] body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [(C {(test)} {($ VSub_Name '$i')} {(-ne)} {(0)})] action: [(C {(echo)} {(DQ ($ VSub_Name '$x'))})] spids: [16777215 103] ) ] spids: [16777215 113] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:i spids:[116]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Percent left: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{($ VSub_Name '$i')}) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) right: (arith_expr.ArithWord w:{(Lit_Digits 10)}) ) spids: [117 128] ) } spids: [116] ) ] spids: [116] ) ] spids: [89 131] ) redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$1'))} ) (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$1') (.new))} ) ] ) (C {(mv)} {(-f)} {(DQ ($ VSub_Number '$1') (.new))} {(DQ ($ VSub_Number '$1'))}) ] spids: [75] ) spids: [70 74] ) (command.FuncDef name: run body: (command.BraceGroup children: [ (C {(echo)} {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)} {(DQ ($ VSub_At '$@'))} ) (command.SimpleCommand words: [{(/usr/bin/time)} {(DQ ($ VSub_At '$@'))}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})] ) ] spids: [166] ) spids: [161 165] ) (C {(test_expect_success)} {(SQ <setup>)} {(SQ <'\n'> <'\tgit commit --allow-empty -m initial &&\n'> <'\tgit tag root\n'>)} ) (command.FuncDef name: do_tests body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:nlines spids:[211]) op: Equal rhs: {($ VSub_Number '$1')} spids: [211] ) (assign_pair lhs: (lhs_expr.LhsName name:pr spids:[214]) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Number 2> suffix_op: (suffix_op.StringUnary op_id:VTest_Hyphen arg_word:{}) spids: [215 218] ) } spids: [214] ) ] spids: [211] ) (C {(test_expect_success)} {($ VSub_Name '$pr')} {(DQ ('setup: ') ($ VSub_Name '$nlines') (' lines'))} { (DQ ('\n') ('\t\trm -f .gitattributes &&\n') ('\t\tgit checkout -q -f master &&\n') ('\t\tgit reset --hard root &&\n') ('\t\tcount ') ($ VSub_Name '$nlines') (' >file &&\n') ('\t\tgit add file &&\n') ('\t\tgit commit -q -m initial &&\n') ('\t\tgit branch -f other &&\n') ('\n') ('\t\tscramble file &&\n') ('\t\tgit add file &&\n') ("\t\tgit commit -q -m 'change big file' &&\n") ('\n') ('\t\tgit checkout -q other &&\n') ('\t\t: >newfile &&\n') ('\t\tgit add newfile &&\n') ("\t\tgit commit -q -m 'add small file' &&\n") ('\n') ('\t\tgit cherry-pick master >/dev/null 2>&1\n') ('\t') ) } ) (C {(test_debug)} {(DQ ('\n') ('\t\trun git diff master^') (Lit_Other '\\') ('!\n') ('\t'))}) (C {(test_expect_success)} {($ VSub_Name '$pr')} {(SQ <'setup attributes'>)} {(DQ ('\n') ("\t\techo 'file binary' >.gitattributes\n") ('\t'))} ) (C {(test_debug)} { (DQ ('\n') ('\t\trun git format-patch --stdout master &&\n') ('\t\trun git format-patch --stdout --ignore-if-in-upstream master\n') ('\t') ) } ) (C {(test_expect_success)} {($ VSub_Name '$pr')} {(SQ <'detect upstream patch'>)} { (SQ <'\n'> <'\t\tgit checkout -q master &&\n'> <'\t\tscramble file &&\n'> <'\t\tgit add file &&\n'> <'\t\tgit commit -q -m "change big file again" &&\n'> <'\t\tgit checkout -q other^{} &&\n'> <'\t\tgit rebase master &&\n'> <'\t\ttest_must_fail test -n "$(git rev-list master...HEAD~)"\n'> <'\t'> ) } ) (C {(test_expect_success)} {($ VSub_Name '$pr')} {(SQ <'do not drop patch'>)} { (SQ <'\n'> <'\t\tgit branch -f squashed master &&\n'> <'\t\tgit checkout -q -f squashed &&\n'> <'\t\tgit reset -q --soft HEAD~2 &&\n'> <'\t\tgit commit -q -m squashed &&\n'> <'\t\tgit checkout -q other^{} &&\n'> <'\t\ttest_must_fail git rebase squashed &&\n'> <'\t\trm -rf .git/rebase-apply\n'> <'\t'> ) } ) ] spids: [208] ) spids: [203 207] ) (C {(do_tests)} {(500)}) (C {(do_tests)} {(50000)} {(EXPENSIVE)}) (C {(test_done)}) ] )