(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description) op: assign_op.Equal rhs: {(SQ <'Revision traversal vs grafts and path limiter'>)} spids: [4] ) ] redirects: [] ) (C {<.>} {<'./test-lib.sh'>}) (C {<test_expect_success>} {<setup>} { (SQ <'\n'> <'\tmkdir subdir &&\n'> <'\techo >fileA fileA &&\n'> <'\techo >subdir/fileB fileB &&\n'> <'\tgit add fileA subdir/fileB &&\n'> <'\tgit commit -a -m "Initial in one history." &&\n'> <'\tA0=$(git rev-parse --verify HEAD) &&\n'> <'\n'> <'\techo >fileA fileA modified &&\n'> <'\tgit commit -a -m "Second in one history." &&\n'> <'\tA1=$(git rev-parse --verify HEAD) &&\n'> <'\n'> <'\techo >subdir/fileB fileB modified &&\n'> <'\tgit commit -a -m "Third in one history." &&\n'> <'\tA2=$(git rev-parse --verify HEAD) &&\n'> <'\n'> <'\trm -f .git/refs/heads/master .git/index &&\n'> <'\n'> <'\techo >fileA fileA again &&\n'> <'\techo >subdir/fileB fileB again &&\n'> <'\tgit add fileA subdir/fileB &&\n'> <'\tgit commit -a -m "Initial in alternate history." &&\n'> <'\tB0=$(git rev-parse --verify HEAD) &&\n'> <'\n'> <'\techo >fileA fileA modified in alternate history &&\n'> <'\tgit commit -a -m "Second in alternate history." &&\n'> <'\tB1=$(git rev-parse --verify HEAD) &&\n'> <'\n'> <'\techo >subdir/fileB fileB modified in alternate history &&\n'> <'\tgit commit -a -m "Third in alternate history." &&\n'> <'\tB2=$(git rev-parse --verify HEAD) &&\n'> <'\t: done\n'> ) } ) (command.ShFunction name: check body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'type='> name:type) op: assign_op.Equal rhs: {($ Id.VSub_Number 1)} spids: [63] ) ] redirects: [] ) (C {<shift>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'arg='> name:arg) op: assign_op.Equal rhs: (rhs_word.Empty) spids: [71] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'which='> name:which) op: assign_op.Equal rhs: {<arg>} spids: [74] ) ] redirects: [] ) (C {<rm>} {<-f>} {<test.expect>}) (command.ForEach iter_names: [a] iterable: (for_iter.Args) body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (C {<test>} {(DQ <z> ($ Id.VSub_DollarName a))} {<Id.Lit_Equals '='>} {<z-->} ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'which='> name:which) op: assign_op.Equal rhs: {<expect>} spids: [110] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'child='> name:child) op: assign_op.Equal rhs: (rhs_word.Empty) spids: [114] ) ] redirects: [] ) (command.ControlFlow token: <Id.ControlFlow_Continue continue> ) ] spids: [93 107] ) ] else_action: [] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (C {<test>} {(DQ ($ Id.VSub_DollarName which))} {<Id.Lit_Equals '='>} {<arg>} ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'arg='> name:arg) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName arg) ($ Id.VSub_DollarName a) <' '>)} spids: [139] ) ] redirects: [] ) (command.ControlFlow token: <Id.ControlFlow_Continue continue> ) ] spids: [123 136] ) ] else_action: [] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (C {<test>} {(DQ ($ Id.VSub_DollarName type))} {<Id.Lit_Equals '='>} {<basic>} ) ] ) action: [(C {<echo>} {(DQ ($ Id.VSub_DollarName a))})] spids: [153 166] ) ] else_action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (C {<test>} {(DQ <z> ($ Id.VSub_DollarName child))} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<z>} ) ] ) action: [ (C {<echo>} {(DQ ($ Id.VSub_DollarName child) <' '> ($ Id.VSub_DollarName a))} ) ] spids: [179 194] ) ] else_action: [] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'child='> name:child) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName a))} spids: [209] ) ] redirects: [] ) ] redirects: [] ) ] ) redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<test.expect>})] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<test>} {(DQ ($ Id.VSub_DollarName type))} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<basic>} ) (C {<test>} {(DQ <z> ($ Id.VSub_DollarName child))} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<z>} ) ] ) ] ) action: [ (command.Simple words: [{<echo>} {($ Id.VSub_DollarName child)}] redirects: [ (redir op: <Id.Redir_DGreat '>>'> loc: (redir_loc.Fd fd:1) arg: {<test.expect>} ) ] more_env: [] do_fork: T ) ] spids: [224 252] ) ] else_action: [] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (C {<test>} {($ Id.VSub_DollarName type)} {<Id.Lit_Equals '='>} {<basic>}) ] ) action: [ (command.Simple words: [{<git>} {<rev-list>} {($ Id.VSub_DollarName arg)}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<test.actual>} ) ] more_env: [] do_fork: T ) ] spids: [266 277] ) (if_arm cond: (condition.Shell commands: [ (C {<test>} {($ Id.VSub_DollarName type)} {<Id.Lit_Equals '='>} {<parents>}) ] ) action: [ (command.Simple words: [{<git>} {<rev-list>} {<--parents>} {($ Id.VSub_DollarName arg)}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<test.actual>} ) ] more_env: [] do_fork: T ) ] spids: [290 301] ) (if_arm cond: (condition.Shell commands: [ (C {<test>} {($ Id.VSub_DollarName type)} {<Id.Lit_Equals '='>} {<parents-raw>}) ] ) action: [ (command.Pipeline children: [ (C {<git>} {<rev-list>} {<--parents>} {<--pretty> <Id.Lit_Equals '='> <raw>} {($ Id.VSub_DollarName arg)} ) (command.Simple words: [{<sed>} {<-n>} {<-e>} {(SQ <'s/^commit //p'>)}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<test.actual>} ) ] more_env: [] do_fork: T ) ] negated: F stderr_indices: [] ) ] spids: [316 327] ) ] else_action: [] redirects: [] ) (C {<test_cmp>} {<test.expect>} {<test.actual>}) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ForEach iter_names: [type] iterable: (for_iter.Words words:[{<basic>} {<parents>} {<parents-raw>}]) body: (command.DoGroup children: [ (C {<test_expect_success>} {(SQ <'without grafts'>)} { (DQ <'\n'> <'\t\trm -f .git/info/grafts &&\n'> <'\t\tcheck '> ($ Id.VSub_DollarName type) <' '> ($ Id.VSub_DollarName B2) <' -- '> ($ Id.VSub_DollarName B2) <' '> ($ Id.VSub_DollarName B1) <' '> ($ Id.VSub_DollarName B0) <'\n'> <'\t'> ) } ) (C {<test_expect_success>} {(SQ <'with grafts'>)} { (DQ <'\n'> <'\t\techo \''> ($ Id.VSub_DollarName B0) <' '> ($ Id.VSub_DollarName A2) <'\' >.git/info/grafts &&\n'> <'\t\tcheck '> ($ Id.VSub_DollarName type) <' '> ($ Id.VSub_DollarName B2) <' -- '> ($ Id.VSub_DollarName B2) <' '> ($ Id.VSub_DollarName B1) <' '> ($ Id.VSub_DollarName B0) <' '> ($ Id.VSub_DollarName A2) <' '> ($ Id.VSub_DollarName A1) <' '> ($ Id.VSub_DollarName A0) <'\n'> <'\t'> ) } ) (C {<test_expect_success>} {(SQ <'without grafts, with pathlimit'>)} { (DQ <'\n'> <'\t\trm -f .git/info/grafts &&\n'> <'\t\tcheck '> ($ Id.VSub_DollarName type) <' '> ($ Id.VSub_DollarName B2) <' subdir -- '> ($ Id.VSub_DollarName B2) <' '> ($ Id.VSub_DollarName B0) <'\n'> <'\t'> ) } ) (C {<test_expect_success>} {(SQ <'with grafts, with pathlimit'>)} { (DQ <'\n'> <'\t\techo \''> ($ Id.VSub_DollarName B0) <' '> ($ Id.VSub_DollarName A2) <'\' >.git/info/grafts &&\n'> <'\t\tcheck '> ($ Id.VSub_DollarName type) <' '> ($ Id.VSub_DollarName B2) <' subdir -- '> ($ Id.VSub_DollarName B2) <' '> ($ Id.VSub_DollarName B0) <' '> ($ Id.VSub_DollarName A2) <' '> ($ Id.VSub_DollarName A0) <'\n'> <'\t'> ) } ) ] ) redirects: [] ) (C {<test_done>}) ] )