(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ (Token id:Id.Lit_Chars val:'basic rebase topology tests' span_id:6))} spids: [4] ) ] ) (C {(.)} {(./test-lib.sh)}) (C {(.)} {(DQ ($ Id.VSub_DollarName '$TEST_DIRECTORY')) (/lib-rebase.sh)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:setup span_id:33))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:37) (Token id:Id.Lit_Chars val:'\ttest_commit a &&\n' span_id:38) (Token id:Id.Lit_Chars val:'\ttest_commit b &&\n' span_id:39) (Token id:Id.Lit_Chars val:'\ttest_commit c &&\n' span_id:40) (Token id:Id.Lit_Chars val:'\tgit checkout b &&\n' span_id:41) (Token id:Id.Lit_Chars val:'\ttest_commit d &&\n' span_id:42) (Token id:Id.Lit_Chars val:'\ttest_commit e\n' span_id:43) ) } ) (command.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [55] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} {(DQ ('simple rebase ') ($ Id.VSub_Star '$*'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.VSub_Star '$*') (' c e &&\n') ('\t\ttest_cmp_rev c HEAD~2 &&\n') ("\t\ttest_linear_range 'd e' c..\n") ('\t') ) } ) ] ) ) (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.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [117] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} {(DQ ('rebase ') ($ Id.VSub_Star '$*') (' is no-op if upstream is an ancestor'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.VSub_Star '$*') (' b e &&\n') ('\t\ttest_cmp_rev e HEAD\n') ('\t') ) } ) ] ) ) (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.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [179] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} { (DQ ('rebase ') ($ Id.VSub_Star '$*') (' -f rewrites even if upstream is an ancestor')) } { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.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') ) } ) ] ) ) (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.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [243] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} {(DQ ('rebase ') ($ Id.VSub_Star '$*') (' fast-forwards from ancestor of upstream'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.VSub_Star '$*') (' e b &&\n') ('\t\ttest_cmp_rev e HEAD\n') ('\t') ) } ) ] ) ) (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 (Token id: Id.Lit_Chars val: 'setup of linear history for range selection tests' span_id: 342 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:346) (Token id:Id.Lit_Chars val:'\tgit checkout c &&\n' span_id:347) (Token id:Id.Lit_Chars val:'\ttest_commit g &&\n' span_id:348) (Token id:Id.Lit_Chars val:'\trevert h g &&\n' span_id:349) (Token id:Id.Lit_Chars val:'\tgit checkout d &&\n' span_id:350) (Token id:Id.Lit_Chars val:'\tcherry_pick gp g &&\n' span_id:351) (Token id:Id.Lit_Chars val:'\ttest_commit i &&\n' span_id:352) (Token id:Id.Lit_Chars val:'\tgit checkout b &&\n' span_id:353) (Token id:Id.Lit_Chars val:'\ttest_commit f\n' span_id:354) ) } ) (command.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [366] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} {(DQ ('rebase ') ($ Id.VSub_Star '$*') (' drops patches in upstream'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.VSub_Star '$*') (' h i &&\n') ('\t\ttest_cmp_rev h HEAD~2 &&\n') ("\t\ttest_linear_range 'd i' h..\n") ('\t') ) } ) ] ) ) (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.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [429] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} {(DQ ('rebase ') ($ Id.VSub_Star '$*') (' can drop last patch if in upstream'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.VSub_Star '$*') (' h gp &&\n') ('\t\ttest_cmp_rev h HEAD^ &&\n') ("\t\ttest_linear_range 'd' h..\n") ('\t') ) } ) ] ) ) (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.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [492] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} {(DQ ('rebase ') ($ Id.VSub_Star '$*') (' --onto drops patches in upstream'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.VSub_Star '$*') (' --onto f h i &&\n') ('\t\ttest_cmp_rev f HEAD~2 &&\n') ("\t\ttest_linear_range 'd i' f..\n") ('\t') ) } ) ] ) ) (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.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [555] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} {(DQ ('rebase ') ($ Id.VSub_Star '$*') (' --onto does not drop patches in onto'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.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') ) } ) ] ) ) (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 (Token id:Id.Lit_Chars val:'setup of linear history for empty commit tests' span_id:628))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:632) (Token id:Id.Lit_Chars val:'\tgit checkout c &&\n' span_id:633) (Token id:Id.Lit_Chars val:'\tmake_empty j &&\n' span_id:634) (Token id:Id.Lit_Chars val:'\tgit checkout d &&\n' span_id:635) (Token id:Id.Lit_Chars val:'\tmake_empty k &&\n' span_id:636) (Token id:Id.Lit_Chars val:'\ttest_commit l\n' span_id:637) ) } ) (command.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [649] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} {(DQ ('rebase ') ($ Id.VSub_Star '$*') (' drops empty commit'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.VSub_Star '$*') (' c l &&\n') ('\t\ttest_cmp_rev c HEAD~2 &&\n') ("\t\ttest_linear_range 'd l' c..\n") ('\t') ) } ) ] ) ) (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.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [712] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} {(DQ ('rebase ') ($ Id.VSub_Star '$*') (' --keep-empty'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.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') ) } ) ] ) ) (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.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [775] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} { (DQ ('rebase ') ($ Id.VSub_Star '$*') (' --keep-empty keeps empty even if already in upstream') ) } { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.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') ) } ) ] ) ) (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 (Token id:Id.Lit_Chars val:'setup of linear history for test involving root' span_id:875))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:879) (Token id:Id.Lit_Chars val:'\tgit checkout b &&\n' span_id:880) (Token id:Id.Lit_Chars val:'\trevert m b &&\n' span_id:881) (Token id:Id.Lit_Chars val:'\tgit checkout --orphan disjoint &&\n' span_id:882) (Token id:Id.Lit_Chars val:'\tgit rm -rf . &&\n' span_id:883) (Token id:Id.Lit_Chars val:'\ttest_commit x &&\n' span_id:884) (Token id:Id.Lit_Chars val:'\ttest_commit y &&\n' span_id:885) (Token id:Id.Lit_Chars val:'\tcherry_pick bp b\n' span_id:886) ) } ) (command.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [898] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} {(DQ ('rebase ') ($ Id.VSub_Star '$*') (' --onto --root'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.VSub_Star '$*') (' --onto c --root y &&\n') ('\t\ttest_cmp_rev c HEAD~2 &&\n') ("\t\ttest_linear_range 'x y' c..\n") ('\t') ) } ) ] ) ) (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.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [961] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} { (DQ ('rebase ') ($ Id.VSub_Star '$*') (' without --onto --root with disjoint history')) } { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.VSub_Star '$*') (' c y &&\n') ('\t\ttest_cmp_rev c HEAD~2 &&\n') ("\t\ttest_linear_range 'x y' c..\n") ('\t') ) } ) ] ) ) (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.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [1024] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} {(DQ ('rebase ') ($ Id.VSub_Star '$*') (' --onto --root drops patch in onto'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.VSub_Star '$*') (' --onto m --root bp &&\n') ('\t\ttest_cmp_rev m HEAD~2 &&\n') ("\t\ttest_linear_range 'x y' m..\n") ('\t') ) } ) ] ) ) (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.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [1087] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} { (DQ ('rebase ') ($ Id.VSub_Star '$*') (' --onto --root with merge-base does not go to root') ) } { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.VSub_Star '$*') (' --onto m --root g &&\n') ('\t\ttest_cmp_rev m HEAD~2 &&\n') ("\t\ttest_linear_range 'c g' m..\n") ('\t') ) } ) ] ) ) (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.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [1151] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} { (DQ ('rebase ') ($ Id.VSub_Star '$*') (' without --onto --root with disjoint history drops patch in onto') ) } { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.VSub_Star '$*') (' m bp &&\n') ('\t\ttest_cmp_rev m HEAD~2 &&\n') ("\t\ttest_linear_range 'x y' m..\n") ('\t') ) } ) ] ) ) (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.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [1214] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} {(DQ ('rebase ') ($ Id.VSub_Star '$*') (' --root on linear history is a no-op'))} { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.VSub_Star '$*') (' --root c &&\n') ('\t\ttest_cmp_rev c HEAD\n') ('\t') ) } ) ] ) ) (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.ShFunction name: test_run_rebase body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:result) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [1276] ) ] ) (C {(shift)}) (C {(test_expect_) ($ Id.VSub_DollarName '$result')} { (DQ ('rebase ') ($ Id.VSub_Star '$*') (' -f --root on linear history causes re-write')) } { (DQ ('\n') ('\t\treset_rebase &&\n') ('\t\tgit rebase ') ($ Id.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') ) } ) ] ) ) (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)}) ] )