(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ <'Revision traversal vs grafts and path limiter'>)} spids: [4] ) ] ) (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 children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:type) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [63] ) ] ) (C {<shift>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:arg) op: assign_op.Equal rhs: (word.Empty) spids: [71] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:which) op: assign_op.Equal rhs: {<arg>} spids: [74] ) ] ) (C {<rm>} {<-f>} {<test.expect>}) (command.ForEach iter_name: a do_arg_iter: T body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (C {<test>} {(DQ <z> ($ Id.VSub_DollarName '$a'))} {<Id.Lit_Equals '='>} {<z-->} ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:which) op: assign_op.Equal rhs: {<expect>} spids: [110] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:child) op: assign_op.Equal rhs: (word.Empty) spids: [114] ) ] ) (command.ControlFlow token: <Id.ControlFlow_Continue continue> ) ] spids: [93 107] ) ] ) (command.If arms: [ (if_arm cond: [ (C {<test>} {(DQ ($ Id.VSub_DollarName '$which'))} {<Id.Lit_Equals '='>} {<arg>} ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:arg) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$arg') ($ Id.VSub_DollarName '$a') <' '> ) } spids: [139] ) ] ) (command.ControlFlow token: <Id.ControlFlow_Continue continue> ) ] spids: [123 136] ) ] ) (command.If arms: [ (if_arm cond: [ (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: [ (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] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:child) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$a'))} spids: [209] ) ] ) ] ) ] ) redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<test.expect>})] ) (command.If arms: [ (if_arm cond: [ (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>} ) ] do_fork: T ) ] spids: [224 252] ) ] ) (command.If arms: [ (if_arm cond: [(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>} ) ] do_fork: T ) ] spids: [266 277] ) (if_arm cond: [ (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>} ) ] do_fork: T ) ] spids: [290 301] ) (if_arm cond: [ (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>} ) ] do_fork: T ) ] negated: F ) ] spids: [316 327] ) ] ) (C {<test_cmp>} {<test.expect>} {<test.actual>}) ] ) ) (command.ForEach iter_name: type iter_words: [{<basic>} {<parents>} {<parents-raw>}] do_arg_iter: F 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'> ) } ) ] ) ) (C {<test_done>}) ] )