(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 <'Tests to check that "reset" options follow a known table'>)} spids: [13] ) ] redirects: [] ) (C {<.>} {<'./test-lib.sh'>}) (C {<test_expect_success>} {(SQ <'creating initial commits'>)} { (SQ <'\n'> <' test_commit E file1 &&\n'> <' test_commit D file1 &&\n'> <' test_commit C file1\n'> ) } ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [(C {<read>} {<W1>} {<I1>} {<H1>} {<T>} {<opt>} {<W2>} {<I2>} {<H2>})] ) body: (command.DoGroup children: [ (C {<test_expect_success>} { (DQ <'check: '> ($ Id.VSub_DollarName W1) <' '> ($ Id.VSub_DollarName I1) <' '> ($ Id.VSub_DollarName H1) <' '> ($ Id.VSub_DollarName T) <' --'> ($ Id.VSub_DollarName opt) <' '> ($ Id.VSub_DollarName W2) <' '> ($ Id.VSub_DollarName I2) <' '> ($ Id.VSub_DollarName H2) ) } { (SQ <'\n'> <'\tgit reset --hard C &&\n'> <'\tif test "$I1" != "$H1"\n'> <'\tthen\n'> <'\t echo "$I1" >file1 &&\n'> <'\t git add file1\n'> <'\tfi &&\n'> <'\tif test "$W1" != "$I1"\n'> <'\tthen\n'> <'\t echo "$W1" >file1\n'> <'\tfi &&\n'> <'\tif test "$W2" != "XXXXX"\n'> <'\tthen\n'> <'\t git reset --$opt $T &&\n'> <'\t test "$(cat file1)" = "$W2" &&\n'> <'\t git checkout-index -f -- file1 &&\n'> <'\t test "$(cat file1)" = "$I2" &&\n'> <'\t git checkout -f HEAD -- file1 &&\n'> <'\t test "$(cat file1)" = "$H2"\n'> <'\telse\n'> <'\t test_must_fail git reset --$opt $T\n'> <'\tfi\n'> <' '> ) } ) ] ) redirects: [ (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'> ch:E) <OF>} here_end_span_id: 145 stdin_parts: [ <'A B C D soft A B D\n'> <'A B C D mixed A D D\n'> <'A B C D hard D D D\n'> <'A B C D merge XXXXX\n'> <'A B C D keep XXXXX\n'> <'A B C C soft A B C\n'> <'A B C C mixed A C C\n'> <'A B C C hard C C C\n'> <'A B C C merge XXXXX\n'> <'A B C C keep A C C\n'> <'B B C D soft B B D\n'> <'B B C D mixed B D D\n'> <'B B C D hard D D D\n'> <'B B C D merge D D D\n'> <'B B C D keep XXXXX\n'> <'B B C C soft B B C\n'> <'B B C C mixed B C C\n'> <'B B C C hard C C C\n'> <'B B C C merge C C C\n'> <'B B C C keep B C C\n'> <'B C C D soft B C D\n'> <'B C C D mixed B D D\n'> <'B C C D hard D D D\n'> <'B C C D merge XXXXX\n'> <'B C C D keep XXXXX\n'> <'B C C C soft B C C\n'> <'B C C C mixed B C C\n'> <'B C C C hard C C C\n'> <'B C C C merge B C C\n'> <'B C C C keep B C C\n'> ] ) ) ] ) (C {<test_expect_success>} {(SQ <'setting up branches to test with unmerged entries'>)} { (SQ <'\n'> <' git reset --hard C &&\n'> <' git branch branch1 &&\n'> <' git branch branch2 &&\n'> <' git checkout branch1 &&\n'> <' test_commit B1 file1 &&\n'> <' git checkout branch2 &&\n'> <' test_commit B file1\n'> ) } ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [(C {<read>} {<W1>} {<I1>} {<H1>} {<T>} {<opt>} {<W2>} {<I2>} {<H2>})] ) body: (command.DoGroup children: [ (C {<test_expect_success>} { (DQ <'check: '> ($ Id.VSub_DollarName W1) <' '> ($ Id.VSub_DollarName I1) <' '> ($ Id.VSub_DollarName H1) <' '> ($ Id.VSub_DollarName T) <' --'> ($ Id.VSub_DollarName opt) <' '> ($ Id.VSub_DollarName W2) <' '> ($ Id.VSub_DollarName I2) <' '> ($ Id.VSub_DollarName H2) ) } { (SQ <'\n'> <'\tgit reset --hard B &&\n'> <'\ttest_must_fail git merge branch1 &&\n'> <'\tcat file1 >X_file1 &&\n'> <'\tif test "$W2" != "XXXXX"\n'> <'\tthen\n'> <'\t git reset --$opt $T &&\n'> <'\t if test "$W2" = "X"\n'> <'\t then\n'> <'\t\ttest_cmp file1 X_file1\n'> <'\t else\n'> <'\t\ttest "$(cat file1)" = "$W2"\n'> <'\t fi &&\n'> <'\t git checkout-index -f -- file1 &&\n'> <'\t test "$(cat file1)" = "$I2" &&\n'> <'\t git checkout -f HEAD -- file1 &&\n'> <'\t test "$(cat file1)" = "$H2"\n'> <'\telse\n'> <'\t test_must_fail git reset --$opt $T\n'> <'\tfi\n'> <' '> ) } ) ] ) redirects: [ (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'> ch:E) <OF>} here_end_span_id: 249 stdin_parts: [ <'X U B C soft XXXXX\n'> <'X U B C mixed X C C\n'> <'X U B C hard C C C\n'> <'X U B C merge C C C\n'> <'X U B C keep XXXXX\n'> <'X U B B soft XXXXX\n'> <'X U B B mixed X B B\n'> <'X U B B hard B B B\n'> <'X U B B merge B B B\n'> <'X U B B keep XXXXX\n'> ] ) ) ] ) (C {<test_done>}) ] )