#!/bin/sh global test_description := ''basic rebase topology tests'' source ./test-lib.sh source "$TEST_DIRECTORY"/lib-rebase.sh # a---b---c # \ # d---e test_expect_success 'setup' ' test_commit a && test_commit b && test_commit c && git checkout b && test_commit d && test_commit e ' proc test_run_rebase { global result := $1 shift test_expect_$result "simple rebase $ifsjoin(Argv)" " reset_rebase && git rebase $ifsjoin(Argv) c e && test_cmp_rev c HEAD~2 && test_linear_range 'd e' c.. " } test_run_rebase success '' test_run_rebase success -m test_run_rebase success -i test_run_rebase success -p proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) is no-op if upstream is an ancestor" " reset_rebase && git rebase $ifsjoin(Argv) b e && test_cmp_rev e HEAD " } test_run_rebase success '' test_run_rebase success -m test_run_rebase success -i test_run_rebase success -p proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) -f rewrites even if upstream is an ancestor" " reset_rebase && git rebase $ifsjoin(Argv) -f b e && ! test_cmp_rev e HEAD && test_cmp_rev b HEAD~2 && test_linear_range 'd e' b.. " } test_run_rebase success '' test_run_rebase success -m test_run_rebase success -i test_run_rebase failure -p proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) fast-forwards from ancestor of upstream" " reset_rebase && git rebase $ifsjoin(Argv) e b && test_cmp_rev e HEAD " } test_run_rebase success '' test_run_rebase success -m test_run_rebase success -i test_run_rebase success -p # f # / # a---b---c---g---h # \ # d---gp--i # # gp = cherry-picked g # h = reverted g # # Reverted patches are there for tests to be able to check if a commit # that introduced the same change as another commit is # dropped. Without reverted commits, we could get false positives # because applying the patch succeeds, but simply results in no # changes. test_expect_success 'setup of linear history for range selection tests' ' git checkout c && test_commit g && revert h g && git checkout d && cherry_pick gp g && test_commit i && git checkout b && test_commit f ' proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) drops patches in upstream" " reset_rebase && git rebase $ifsjoin(Argv) h i && test_cmp_rev h HEAD~2 && test_linear_range 'd i' h.. " } test_run_rebase success '' test_run_rebase failure -m test_run_rebase success -i test_run_rebase success -p proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) can drop last patch if in upstream" " reset_rebase && git rebase $ifsjoin(Argv) h gp && test_cmp_rev h HEAD^ && test_linear_range 'd' h.. " } test_run_rebase success '' test_run_rebase failure -m test_run_rebase success -i test_run_rebase success -p proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) --onto drops patches in upstream" " reset_rebase && git rebase $ifsjoin(Argv) --onto f h i && test_cmp_rev f HEAD~2 && test_linear_range 'd i' f.. " } test_run_rebase success '' test_run_rebase failure -m test_run_rebase success -i test_run_rebase success -p proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) --onto does not drop patches in onto" " reset_rebase && git rebase $ifsjoin(Argv) --onto h f i && test_cmp_rev h HEAD~3 && test_linear_range 'd gp i' h.. " } test_run_rebase success '' test_run_rebase success -m test_run_rebase success -i test_run_rebase success -p # a---b---c---j! # \ # d---k!--l # # ! = empty test_expect_success 'setup of linear history for empty commit tests' ' git checkout c && make_empty j && git checkout d && make_empty k && test_commit l ' proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) drops empty commit" " reset_rebase && git rebase $ifsjoin(Argv) c l && test_cmp_rev c HEAD~2 && test_linear_range 'd l' c.. " } test_run_rebase success '' test_run_rebase success -m test_run_rebase success -i test_run_rebase success -p proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) --keep-empty" " reset_rebase && git rebase $ifsjoin(Argv) --keep-empty c l && test_cmp_rev c HEAD~3 && test_linear_range 'd k l' c.. " } test_run_rebase success '' test_run_rebase failure -m test_run_rebase success -i test_run_rebase failure -p proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) --keep-empty keeps empty even if already in upstream" " reset_rebase && git rebase $ifsjoin(Argv) --keep-empty j l && test_cmp_rev j HEAD~3 && test_linear_range 'd k l' j.. " } test_run_rebase success '' test_run_rebase failure -m test_run_rebase failure -i test_run_rebase failure -p # m # / # a---b---c---g # # x---y---bp # # bp = cherry-picked b # m = reverted b # # Reverted patches are there for tests to be able to check if a commit # that introduced the same change as another commit is # dropped. Without reverted commits, we could get false positives # because applying the patch succeeds, but simply results in no # changes. test_expect_success 'setup of linear history for test involving root' ' git checkout b && revert m b && git checkout --orphan disjoint && git rm -rf . && test_commit x && test_commit y && cherry_pick bp b ' proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) --onto --root" " reset_rebase && git rebase $ifsjoin(Argv) --onto c --root y && test_cmp_rev c HEAD~2 && test_linear_range 'x y' c.. " } test_run_rebase success '' test_run_rebase success -m test_run_rebase success -i test_run_rebase success -p proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) without --onto --root with disjoint history" " reset_rebase && git rebase $ifsjoin(Argv) c y && test_cmp_rev c HEAD~2 && test_linear_range 'x y' c.. " } test_run_rebase success '' test_run_rebase success -m test_run_rebase success -i test_run_rebase failure -p proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) --onto --root drops patch in onto" " reset_rebase && git rebase $ifsjoin(Argv) --onto m --root bp && test_cmp_rev m HEAD~2 && test_linear_range 'x y' m.. " } test_run_rebase success '' test_run_rebase failure -m test_run_rebase success -i test_run_rebase success -p proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) --onto --root with merge-base does not go to root" " reset_rebase && git rebase $ifsjoin(Argv) --onto m --root g && test_cmp_rev m HEAD~2 && test_linear_range 'c g' m.. " } test_run_rebase success '' test_run_rebase success -m test_run_rebase success -i test_run_rebase failure -p proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) without --onto --root with disjoint history drops patch in onto" " reset_rebase && git rebase $ifsjoin(Argv) m bp && test_cmp_rev m HEAD~2 && test_linear_range 'x y' m.. " } test_run_rebase success '' test_run_rebase failure -m test_run_rebase success -i test_run_rebase failure -p proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) --root on linear history is a no-op" " reset_rebase && git rebase $ifsjoin(Argv) --root c && test_cmp_rev c HEAD " } test_run_rebase failure '' test_run_rebase failure -m test_run_rebase failure -i test_run_rebase failure -p proc test_run_rebase { global result := $1 shift test_expect_$result "rebase $ifsjoin(Argv) -f --root on linear history causes re-write" " reset_rebase && git rebase $ifsjoin(Argv) -f --root c && ! test_cmp_rev a HEAD~2 && test_linear_range 'a b c' HEAD " } test_run_rebase success '' test_run_rebase success -m test_run_rebase success -i test_run_rebase success -p test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"basic rebase topology tests">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(.)} {(DQ ($ VSub_Name "$TEST_DIRECTORY")) (/lib-rebase.sh)}) (C {(test_expect_success)} {(SQ )} { (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"> ) } ) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [55] ) ] spids: [55] ) (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: [52] ) spids: [47 51] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [117] ) ] spids: [117] ) (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: [114] ) spids: [109 113] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [179] ) ] spids: [179] ) (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: [176] ) spids: [171 175] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(failure)} {(-p)}) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [243] ) ] spids: [243] ) (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: [240] ) spids: [235 239] ) (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"> ) } ) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [366] ) ] spids: [366] ) (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: [363] ) spids: [358 362] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(failure)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [429] ) ] spids: [429] ) (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: [426] ) spids: [421 425] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(failure)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [492] ) ] spids: [492] ) (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: [489] ) spids: [484 488] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(failure)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [555] ) ] spids: [555] ) (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: [552] ) spids: [547 551] ) (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"> ) } ) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [649] ) ] spids: [649] ) (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: [646] ) spids: [641 645] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [712] ) ] spids: [712] ) (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: [709] ) spids: [704 708] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(failure)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(failure)} {(-p)}) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [775] ) ] spids: [775] ) (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: [772] ) spids: [767 771] ) (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"> ) } ) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [898] ) ] spids: [898] ) (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: [895] ) spids: [890 894] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [961] ) ] spids: [961] ) (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: [958] ) spids: [953 957] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(failure)} {(-p)}) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [1024] ) ] spids: [1024] ) (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: [1021] ) spids: [1016 1020] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(failure)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(success)} {(-p)}) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [1087] ) ] spids: [1087] ) (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: [1084] ) spids: [1079 1083] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(success)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(failure)} {(-p)}) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [1151] ) ] spids: [1151] ) (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: [1148] ) spids: [1143 1147] ) (C {(test_run_rebase)} {(success)} {(SQ )}) (C {(test_run_rebase)} {(failure)} {(-m)}) (C {(test_run_rebase)} {(success)} {(-i)}) (C {(test_run_rebase)} {(failure)} {(-p)}) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [1214] ) ] spids: [1214] ) (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: [1211] ) spids: [1206 1210] ) (C {(test_run_rebase)} {(failure)} {(SQ )}) (C {(test_run_rebase)} {(failure)} {(-m)}) (C {(test_run_rebase)} {(failure)} {(-i)}) (C {(test_run_rebase)} {(failure)} {(-p)}) (FuncDef name: test_run_rebase body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_Number "$1")} spids: [1276] ) ] spids: [1276] ) (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: [1273] ) spids: [1268 1272] ) (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)}) ] )