#!/bin/sh global test_description := ''bisect can handle submodules'' source ./test-lib.sh source "$TEST_DIRECTORY"/lib-submodule-update.sh proc git_bisect { git status -su >expect && ls -1pR * >>expect && tar cf "$TRASH_DIRECTORY/tmp.tar" * && global GOOD := $[git rev-parse --verify HEAD] && git checkout $1 && echo "foo" >bar && git add bar && git commit -m "bisect bad" && global BAD := $[git rev-parse --verify HEAD] && git reset --hard HEAD^^ && git submodule update && git bisect start && git bisect good $GOOD && rm -rf * && tar xf "$TRASH_DIRECTORY/tmp.tar" && git status -su >actual && ls -1pR * >>actual && test_cmp expect actual && git bisect bad $BAD } test_submodule_switch "git_bisect" test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"bisect can handle submodules">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(.)} {(DQ ($ VSub_Name "$TEST_DIRECTORY")) (/lib-submodule-update.sh)}) (FuncDef name: git_bisect body: (BraceGroup children: [ (AndOr children: [ (SimpleCommand words: [{(git)} {(status)} {(-su)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[36])] ) (AndOr children: [ (SimpleCommand words: [{(ls)} {(-1pR)} {(Lit_Other "*")}] redirects: [(Redir op_id:Redir_DGreat fd:-1 arg_word:{(expect)} spids:[48])] ) (AndOr children: [ (C {(tar)} {(cf)} {(DQ ($ VSub_Name "$TRASH_DIRECTORY") (/tmp.tar))} {(Lit_Other "*")} ) (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:GOOD) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(git)} {(rev-parse)} {(--verify)} {(HEAD)})] ) left_token: spids: [69 77] ) } spids: [68] ) ] spids: [68] ) (AndOr children: [ (C {(git)} {(checkout)} {(DQ ($ VSub_Number "$1"))}) (AndOr children: [ (SimpleCommand words: [{(echo)} {(DQ (foo))}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(bar)} spids: [99] ) ] ) (AndOr children: [ (C {(git)} {(add)} {(bar)}) (AndOr children: [ (C {(git)} {(commit)} {(-m)} {(DQ ("bisect bad"))}) (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:BAD) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(rev-parse)} {(--verify)} {(HEAD)} ) ] ) left_token: spids: [128 136] ) } spids: [127] ) ] spids: [127] ) (AndOr children: [ (C {(git)} {(reset)} {(--hard)} {(HEAD) (Lit_Other "^") (Lit_Other "^")} ) (AndOr children: [ (C {(git)} {(submodule)} {(update)}) (AndOr children: [ (C {(git)} {(bisect)} {(start)}) (AndOr children: [ (C {(git)} {(bisect)} {(good)} {($ VSub_Name "$GOOD")} ) (AndOr children: [ (C {(rm)} {(-rf)} {(Lit_Other "*")}) (AndOr children: [ (C {(tar)} {(xf)} { (DQ ($ VSub_Name "$TRASH_DIRECTORY" ) (/tmp.tar) ) } ) (AndOr children: [ (SimpleCommand words: [ {(git)} {(status)} {(-su)} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(actual)} spids: [210] ) ] ) (AndOr children: [ (SimpleCommand words: [ {(ls)} {(-1pR)} { (Lit_Other "*" ) } ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(actual)} spids: [222] ) ] ) (AndOr children: [ (C {(test_cmp)} {(expect)} {(actual)} ) (C {(git)} {(bisect)} {(bad)} {($ VSub_Name "$BAD")} ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] spids: [27] ) spids: [22 26] ) (C {(test_submodule_switch)} {(DQ (git_bisect))}) (C {(test_done)}) ] )