(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description spids:[12]) op: Equal rhs: {(SQ <'basic rebase topology tests'>)} spids: [12] ) ] spids: [12] ) (C {(.)} {(./test-lib.sh)}) (C {(.)} {(DQ ($ VSub_Name '$TEST_DIRECTORY')) (/lib-rebase.sh)}) (C {(test_expect_success)} {(SQ <setup>)} { (SQ <'\n'> <'\ttest_commit a &&\n'> <'\ttest_commit b &&\n'> <'\ttest_commit c &&\n'> <'\tgit checkout b &&\n'> <'\ttest_commit d &&\n'> <'\ttest_commit e\n'> ) } ) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[63]) op: Equal rhs: {($ VSub_Number '$1')} spids: [63] ) ] spids: [63] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} {(DQ ('simple rebase ') ($ VSub_Star '$*'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' c e &&\n') ('\t\ttest_cmp_rev c HEAD~2 &&\n') ("\t\ttest_linear_range 'd e' c..\n") ('\t') ) } ) ] spids: [60] ) spids: [55 59] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[125]) op: Equal rhs: {($ VSub_Number '$1')} spids: [125] ) ] spids: [125] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} {(DQ ('rebase ') ($ VSub_Star '$*') (' is no-op if upstream is an ancestor'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' b e &&\n') ('\t\ttest_cmp_rev e HEAD\n') ('\t') ) } ) ] spids: [122] ) spids: [117 121] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[187]) op: Equal rhs: {($ VSub_Number '$1')} spids: [187] ) ] spids: [187] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} {(DQ ('rebase ') ($ VSub_Star '$*') (' -f rewrites even if upstream is an ancestor'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' -f b e &&\n') ('\t\t! test_cmp_rev e HEAD &&\n') ('\t\ttest_cmp_rev b HEAD~2 &&\n') ("\t\ttest_linear_range 'd e' b..\n") ('\t') ) } ) ] spids: [184] ) spids: [179 183] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(failure)} {(-p)}) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[251]) op: Equal rhs: {($ VSub_Number '$1')} spids: [251] ) ] spids: [251] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} {(DQ ('rebase ') ($ VSub_Star '$*') (' fast-forwards from ancestor of upstream'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' e b &&\n') ('\t\ttest_cmp_rev e HEAD\n') ('\t') ) } ) ] spids: [248] ) spids: [243 247] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (C {(test_expect_success)} {(SQ <'setup of linear history for range selection tests'>)} { (SQ <'\n'> <'\tgit checkout c &&\n'> <'\ttest_commit g &&\n'> <'\trevert h g &&\n'> <'\tgit checkout d &&\n'> <'\tcherry_pick gp g &&\n'> <'\ttest_commit i &&\n'> <'\tgit checkout b &&\n'> <'\ttest_commit f\n'> ) } ) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[374]) op: Equal rhs: {($ VSub_Number '$1')} spids: [374] ) ] spids: [374] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} {(DQ ('rebase ') ($ VSub_Star '$*') (' drops patches in upstream'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' h i &&\n') ('\t\ttest_cmp_rev h HEAD~2 &&\n') ("\t\ttest_linear_range 'd i' h..\n") ('\t') ) } ) ] spids: [371] ) spids: [366 370] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(failure)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[437]) op: Equal rhs: {($ VSub_Number '$1')} spids: [437] ) ] spids: [437] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} {(DQ ('rebase ') ($ VSub_Star '$*') (' can drop last patch if in upstream'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' h gp &&\n') ('\t\ttest_cmp_rev h HEAD^ &&\n') ("\t\ttest_linear_range 'd' h..\n") ('\t') ) } ) ] spids: [434] ) spids: [429 433] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(failure)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[500]) op: Equal rhs: {($ VSub_Number '$1')} spids: [500] ) ] spids: [500] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} {(DQ ('rebase ') ($ VSub_Star '$*') (' --onto drops patches in upstream'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' --onto f h i &&\n') ('\t\ttest_cmp_rev f HEAD~2 &&\n') ("\t\ttest_linear_range 'd i' f..\n") ('\t') ) } ) ] spids: [497] ) spids: [492 496] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(failure)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[563]) op: Equal rhs: {($ VSub_Number '$1')} spids: [563] ) ] spids: [563] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} {(DQ ('rebase ') ($ VSub_Star '$*') (' --onto does not drop patches in onto'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' --onto h f i &&\n') ('\t\ttest_cmp_rev h HEAD~3 &&\n') ("\t\ttest_linear_range 'd gp i' h..\n") ('\t') ) } ) ] spids: [560] ) spids: [555 559] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (C {(test_expect_success)} {(SQ <'setup of linear history for empty commit tests'>)} { (SQ <'\n'> <'\tgit checkout c &&\n'> <'\tmake_empty j &&\n'> <'\tgit checkout d &&\n'> <'\tmake_empty k &&\n'> <'\ttest_commit l\n'> ) } ) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[657]) op: Equal rhs: {($ VSub_Number '$1')} spids: [657] ) ] spids: [657] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} {(DQ ('rebase ') ($ VSub_Star '$*') (' drops empty commit'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' c l &&\n') ('\t\ttest_cmp_rev c HEAD~2 &&\n') ("\t\ttest_linear_range 'd l' c..\n") ('\t') ) } ) ] spids: [654] ) spids: [649 653] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[720]) op: Equal rhs: {($ VSub_Number '$1')} spids: [720] ) ] spids: [720] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} {(DQ ('rebase ') ($ VSub_Star '$*') (' --keep-empty'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' --keep-empty c l &&\n') ('\t\ttest_cmp_rev c HEAD~3 &&\n') ("\t\ttest_linear_range 'd k l' c..\n") ('\t') ) } ) ] spids: [717] ) spids: [712 716] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(failure)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(failure)} {(-p)}) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[783]) op: Equal rhs: {($ VSub_Number '$1')} spids: [783] ) ] spids: [783] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} { (DQ ('rebase ') ($ VSub_Star '$*') (' --keep-empty keeps empty even if already in upstream') ) } { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' --keep-empty j l &&\n') ('\t\ttest_cmp_rev j HEAD~3 &&\n') ("\t\ttest_linear_range 'd k l' j..\n") ('\t') ) } ) ] spids: [780] ) spids: [775 779] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(failure)} {(-m)}) (C {(test_run_rebase)} {(failure)} {(-i)}) (C {(test_run_rebase)} {(failure)} {(-p)}) (C {(test_expect_success)} {(SQ <'setup of linear history for test involving root'>)} { (SQ <'\n'> <'\tgit checkout b &&\n'> <'\trevert m b &&\n'> <'\tgit checkout --orphan disjoint &&\n'> <'\tgit rm -rf . &&\n'> <'\ttest_commit x &&\n'> <'\ttest_commit y &&\n'> <'\tcherry_pick bp b\n'> ) } ) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[906]) op: Equal rhs: {($ VSub_Number '$1')} spids: [906] ) ] spids: [906] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} {(DQ ('rebase ') ($ VSub_Star '$*') (' --onto --root'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' --onto c --root y &&\n') ('\t\ttest_cmp_rev c HEAD~2 &&\n') ("\t\ttest_linear_range 'x y' c..\n") ('\t') ) } ) ] spids: [903] ) spids: [898 902] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[969]) op: Equal rhs: {($ VSub_Number '$1')} spids: [969] ) ] spids: [969] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} {(DQ ('rebase ') ($ VSub_Star '$*') (' without --onto --root with disjoint history'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' c y &&\n') ('\t\ttest_cmp_rev c HEAD~2 &&\n') ("\t\ttest_linear_range 'x y' c..\n") ('\t') ) } ) ] spids: [966] ) spids: [961 965] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(failure)} {(-p)}) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[1032]) op: Equal rhs: {($ VSub_Number '$1')} spids: [1032] ) ] spids: [1032] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} {(DQ ('rebase ') ($ VSub_Star '$*') (' --onto --root drops patch in onto'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' --onto m --root bp &&\n') ('\t\ttest_cmp_rev m HEAD~2 &&\n') ("\t\ttest_linear_range 'x y' m..\n") ('\t') ) } ) ] spids: [1029] ) spids: [1024 1028] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(failure)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[1095]) op: Equal rhs: {($ VSub_Number '$1')} spids: [1095] ) ] spids: [1095] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} { (DQ ('rebase ') ($ VSub_Star '$*') (' --onto --root with merge-base does not go to root') ) } { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' --onto m --root g &&\n') ('\t\ttest_cmp_rev m HEAD~2 &&\n') ("\t\ttest_linear_range 'c g' m..\n") ('\t') ) } ) ] spids: [1092] ) spids: [1087 1091] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(failure)} {(-p)}) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[1159]) op: Equal rhs: {($ VSub_Number '$1')} spids: [1159] ) ] spids: [1159] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} { (DQ ('rebase ') ($ VSub_Star '$*') (' without --onto --root with disjoint history drops patch in onto') ) } { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' m bp &&\n') ('\t\ttest_cmp_rev m HEAD~2 &&\n') ("\t\ttest_linear_range 'x y' m..\n") ('\t') ) } ) ] spids: [1156] ) spids: [1151 1155] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(failure)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(failure)} {(-p)}) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[1222]) op: Equal rhs: {($ VSub_Number '$1')} spids: [1222] ) ] spids: [1222] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} {(DQ ('rebase ') ($ VSub_Star '$*') (' --root on linear history is a no-op'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' --root c &&\n') ('\t\ttest_cmp_rev c HEAD\n') ('\t') ) } ) ] spids: [1219] ) spids: [1214 1218] ) (C {(test_run_rebase)} {(failure)} {(SQ )}) (C {(test_run_rebase)} {(failure)} {(-m)}) (C {(test_run_rebase)} {(failure)} {(-i)}) (C {(test_run_rebase)} {(failure)} {(-p)}) (command.FuncDef name: test_run_rebase body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[1284]) op: Equal rhs: {($ VSub_Number '$1')} spids: [1284] ) ] spids: [1284] ) (C {(shift)}) (C {(test_expect_) ($ VSub_Name '$result')} {(DQ ('rebase ') ($ VSub_Star '$*') (' -f --root on linear history causes re-write'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ VSub_Star '$*') (' -f --root c &&\n') ('\t\t! test_cmp_rev a HEAD~2 &&\n') ("\t\ttest_linear_range 'a b c' HEAD\n") ('\t') ) } ) ] spids: [1281] ) spids: [1276 1280] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (C {(test_done)}) ] )