(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:'git rebase with its hook(s)' span_id:6))} spids: [4] ) ] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(setup)} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:20) (Token id:Id.Lit_Chars val:'\techo hello >file &&\n' span_id:21) (Token id:Id.Lit_Chars val:'\tgit add file &&\n' span_id:22) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:23) (Token id:Id.Lit_Chars val:'\tgit commit -m initial &&\n' span_id:24) (Token id:Id.Lit_Chars val:'\techo goodbye >file &&\n' span_id:25) (Token id:Id.Lit_Chars val:'\tgit add file &&\n' span_id:26) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:27) (Token id:Id.Lit_Chars val:'\tgit commit -m second &&\n' span_id:28) (Token id:Id.Lit_Chars val:'\tgit checkout -b side HEAD^ &&\n' span_id:29) (Token id:Id.Lit_Chars val:'\techo world >git &&\n' span_id:30) (Token id:Id.Lit_Chars val:'\tgit add git &&\n' span_id:31) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:32) (Token id:Id.Lit_Chars val:'\tgit commit -m side &&\n' span_id:33) (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:34) (Token id: Id.Lit_Chars val: '\tgit log --pretty=oneline --abbrev-commit --graph --all &&\n' span_id: 35 ) (Token id:Id.Lit_Chars val:'\tgit branch test side\n' span_id:36) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:rebase span_id:43))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:47) (Token id:Id.Lit_Chars val:'\tgit checkout test &&\n' span_id:48) (Token id:Id.Lit_Chars val:'\tgit reset --hard side &&\n' span_id:49) (Token id:Id.Lit_Chars val:'\tgit rebase master &&\n' span_id:50) (Token id:Id.Lit_Chars val:'\ttest "z$(cat git)" = zworld\n' span_id:51) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'rebase -i' span_id:58))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:62) (Token id:Id.Lit_Chars val:'\tgit checkout test &&\n' span_id:63) (Token id:Id.Lit_Chars val:'\tgit reset --hard side &&\n' span_id:64) (Token id:Id.Lit_Chars val:'\tEDITOR=true git rebase -i master &&\n' span_id:65) (Token id:Id.Lit_Chars val:'\ttest "z$(cat git)" = zworld\n' span_id:66) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'setup pre-rebase hook' span_id:73))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:77) (Token id:Id.Lit_Chars val:'\tmkdir -p .git/hooks &&\n' span_id:78) (Token id:Id.Lit_Chars val:'\tcat >.git/hooks/pre-rebase <<EOF &&\n' span_id:79) (Token id:Id.Lit_Chars val:'#!$SHELL_PATH\n' span_id:80) (Token id:Id.Lit_Chars val:'echo "\\$1,\\$2" >.git/PRE-REBASE-INPUT\n' span_id:81) (Token id:Id.Lit_Chars val:'EOF\n' span_id:82) (Token id:Id.Lit_Chars val:'\tchmod +x .git/hooks/pre-rebase\n' span_id:83) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'pre-rebase hook gets correct input (1)' span_id:90))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:94) (Token id:Id.Lit_Chars val:'\tgit checkout test &&\n' span_id:95) (Token id:Id.Lit_Chars val:'\tgit reset --hard side &&\n' span_id:96) (Token id:Id.Lit_Chars val:'\tgit rebase master &&\n' span_id:97) (Token id:Id.Lit_Chars val:'\ttest "z$(cat git)" = zworld &&\n' span_id:98) (Token id: Id.Lit_Chars val: '\ttest "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,\n' span_id: 99 ) (Token id:Id.Lit_Chars val:'\n' span_id:100) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'pre-rebase hook gets correct input (2)' span_id:107))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:111) (Token id:Id.Lit_Chars val:'\tgit checkout test &&\n' span_id:112) (Token id:Id.Lit_Chars val:'\tgit reset --hard side &&\n' span_id:113) (Token id:Id.Lit_Chars val:'\tgit rebase master test &&\n' span_id:114) (Token id:Id.Lit_Chars val:'\ttest "z$(cat git)" = zworld &&\n' span_id:115) (Token id: Id.Lit_Chars val: '\ttest "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test\n' span_id: 116 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'pre-rebase hook gets correct input (3)' span_id:123))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:127) (Token id:Id.Lit_Chars val:'\tgit checkout test &&\n' span_id:128) (Token id:Id.Lit_Chars val:'\tgit reset --hard side &&\n' span_id:129) (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:130) (Token id:Id.Lit_Chars val:'\tgit rebase master test &&\n' span_id:131) (Token id:Id.Lit_Chars val:'\ttest "z$(cat git)" = zworld &&\n' span_id:132) (Token id:Id.Lit_Chars val:'\ttest "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test\n' span_id:133) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'pre-rebase hook gets correct input (4)' span_id:140))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:144) (Token id:Id.Lit_Chars val:'\tgit checkout test &&\n' span_id:145) (Token id:Id.Lit_Chars val:'\tgit reset --hard side &&\n' span_id:146) (Token id:Id.Lit_Chars val:'\tEDITOR=true git rebase -i master &&\n' span_id:147) (Token id:Id.Lit_Chars val:'\ttest "z$(cat git)" = zworld &&\n' span_id:148) (Token id: Id.Lit_Chars val: '\ttest "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,\n' span_id: 149 ) (Token id:Id.Lit_Chars val:'\n' span_id:150) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'pre-rebase hook gets correct input (5)' span_id:157))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:161) (Token id:Id.Lit_Chars val:'\tgit checkout test &&\n' span_id:162) (Token id:Id.Lit_Chars val:'\tgit reset --hard side &&\n' span_id:163) (Token id: Id.Lit_Chars val: '\tEDITOR=true git rebase -i master test &&\n' span_id: 164 ) (Token id:Id.Lit_Chars val:'\ttest "z$(cat git)" = zworld &&\n' span_id:165) (Token id: Id.Lit_Chars val: '\ttest "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test\n' span_id: 166 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'pre-rebase hook gets correct input (6)' span_id:173))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:177) (Token id:Id.Lit_Chars val:'\tgit checkout test &&\n' span_id:178) (Token id:Id.Lit_Chars val:'\tgit reset --hard side &&\n' span_id:179) (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:180) (Token id:Id.Lit_Chars val:'\tEDITOR=true git rebase -i master test &&\n' span_id:181) (Token id:Id.Lit_Chars val:'\ttest "z$(cat git)" = zworld &&\n' span_id:182) (Token id:Id.Lit_Chars val:'\ttest "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test\n' span_id:183) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'setup pre-rebase hook that fails' span_id:190))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:194) (Token id:Id.Lit_Chars val:'\tmkdir -p .git/hooks &&\n' span_id:195) (Token id:Id.Lit_Chars val:'\tcat >.git/hooks/pre-rebase <<EOF &&\n' span_id:196) (Token id:Id.Lit_Chars val:'#!$SHELL_PATH\n' span_id:197) (Token id:Id.Lit_Chars val:'false\n' span_id:198) (Token id:Id.Lit_Chars val:'EOF\n' span_id:199) (Token id:Id.Lit_Chars val:'\tchmod +x .git/hooks/pre-rebase\n' span_id:200) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'pre-rebase hook stops rebase (1)' span_id:207))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:211) (Token id:Id.Lit_Chars val:'\tgit checkout test &&\n' span_id:212) (Token id:Id.Lit_Chars val:'\tgit reset --hard side &&\n' span_id:213) (Token id:Id.Lit_Chars val:'\ttest_must_fail git rebase master &&\n' span_id:214) (Token id:Id.Lit_Chars val:'\ttest "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&\n' span_id:215) (Token id: Id.Lit_Chars val: '\ttest 0 = $(git rev-list HEAD...side | wc -l)\n' span_id: 216 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'pre-rebase hook stops rebase (2)' span_id:223))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:227) (Token id:Id.Lit_Chars val:'\tgit checkout test &&\n' span_id:228) (Token id:Id.Lit_Chars val:'\tgit reset --hard side &&\n' span_id:229) (Token id: Id.Lit_Chars val: '\ttest_must_fail env EDITOR=: git rebase -i master &&\n' span_id: 230 ) (Token id:Id.Lit_Chars val:'\ttest "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&\n' span_id:231) (Token id: Id.Lit_Chars val: '\ttest 0 = $(git rev-list HEAD...side | wc -l)\n' span_id: 232 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'rebase --no-verify overrides pre-rebase (1)' span_id:239))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:243) (Token id:Id.Lit_Chars val:'\tgit checkout test &&\n' span_id:244) (Token id:Id.Lit_Chars val:'\tgit reset --hard side &&\n' span_id:245) (Token id:Id.Lit_Chars val:'\tgit rebase --no-verify master &&\n' span_id:246) (Token id:Id.Lit_Chars val:'\ttest "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&\n' span_id:247) (Token id:Id.Lit_Chars val:'\ttest "z$(cat git)" = zworld\n' span_id:248) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'rebase --no-verify overrides pre-rebase (2)' span_id:255))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:259) (Token id:Id.Lit_Chars val:'\tgit checkout test &&\n' span_id:260) (Token id:Id.Lit_Chars val:'\tgit reset --hard side &&\n' span_id:261) (Token id: Id.Lit_Chars val: '\tEDITOR=true git rebase --no-verify -i master &&\n' span_id: 262 ) (Token id:Id.Lit_Chars val:'\ttest "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&\n' span_id:263) (Token id:Id.Lit_Chars val:'\ttest "z$(cat git)" = zworld\n' span_id:264) ) } ) (C {(test_done)}) ] )