(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 reset\n' span_id:15) (Token id:Id.Lit_Chars val:'\n' span_id:16) (Token id:Id.Lit_Chars val:'Documented tests for git reset' span_id:17) ) } spids: [13] ) ] ) (C {(.)} {(./test-lib.sh)}) (command.ShFunction name: commit_msg body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:msg) op: assign_op.Equal rhs: { (DQ ('modify 2nd file (ge') (Id.Lit_Other '\\') (303) (Id.Lit_Other '\\') ('244ndert)') (Id.Lit_Other '\\') (n) ) } spids: [46] ) ] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(-n)} {(DQ ($ Id.VSub_Number '$1'))})] action: [ (command.Pipeline children: [ (C {(printf)} {(DQ ($ Id.VSub_DollarName '$msg'))}) (C {(iconv)} {(-f)} {(utf-8)} {(-t)} {(DQ ($ Id.VSub_Number '$1'))}) ] negated: F ) ] spids: [58 69] ) ] else_action: [(C {(printf)} {(DQ ($ Id.VSub_DollarName '$msg'))})] ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_encoding) op: assign_op.Equal rhs: {(DQ (ISO8859-1))} spids: [111] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'creating initial files and commits' span_id:120))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:124) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:125) (Token id:Id.Lit_Chars val:'\techo "1st file" >first &&\n' span_id:126) (Token id:Id.Lit_Chars val:'\tgit add first &&\n' span_id:127) (Token id:Id.Lit_Chars val:'\tgit commit -m "create 1st file" &&\n' span_id:128) (Token id:Id.Lit_Chars val:'\n' span_id:129) (Token id:Id.Lit_Chars val:'\techo "2nd file" >second &&\n' span_id:130) (Token id:Id.Lit_Chars val:'\tgit add second &&\n' span_id:131) (Token id:Id.Lit_Chars val:'\tgit commit -m "create 2nd file" &&\n' span_id:132) (Token id:Id.Lit_Chars val:'\n' span_id:133) (Token id:Id.Lit_Chars val:'\techo "2nd line 1st file" >>first &&\n' span_id:134) (Token id: Id.Lit_Chars val: '\tgit commit -a -m "modify 1st file" &&\n' span_id: 135 ) (Token id:Id.Lit_Chars val:'\n' span_id:136) (Token id:Id.Lit_Chars val:'\tgit rm first &&\n' span_id:137) (Token id:Id.Lit_Chars val:'\tgit mv second secondfile &&\n' span_id:138) (Token id: Id.Lit_Chars val: '\tgit commit -a -m "remove 1st and rename 2nd" &&\n' span_id: 139 ) (Token id:Id.Lit_Chars val:'\n' span_id:140) (Token id: Id.Lit_Chars val: '\techo "1st line 2nd file" >secondfile &&\n' span_id: 141 ) (Token id:Id.Lit_Chars val:'\techo "2nd line 2nd file" >>secondfile &&\n' span_id:142) (Token id: Id.Lit_Chars val: '\t# "git commit -m" would break MinGW, as Windows refuse to pass\n' span_id: 143 ) (Token id:Id.Lit_Chars val:'\t# $test_encoding encoded parameter to git.\n' span_id:144) (Token id: Id.Lit_Chars val: '\tcommit_msg $test_encoding | git -c "i18n.commitEncoding=$test_encoding" commit -a -F - &&\n' span_id: 145 ) (Token id:Id.Lit_Chars val:'\thead5=$(git rev-parse --verify HEAD)\n' span_id:146) ) } ) (command.ShFunction name: check_changes body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (C {(test)} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:164) command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(HEAD)})] ) ) ) } {(Id.Lit_Equals '=')} {(DQ ($ Id.VSub_Number '$1'))} ) (command.Pipeline children: [(C {(git)} {(diff)}) (C {(test_cmp)} {(.diff_expect)} {(-)})] negated: F ) (command.Pipeline children: [(C {(git)} {(diff)} {(--cached)}) (C {(test_cmp)} {(.cached_expect)} {(-)})] negated: F ) (command.Pipeline children: [ (command.ForEach iter_name: FILE iter_words: [{(Id.Lit_Star '*')}] do_arg_iter: F body: (command.DoGroup children: [ (C {(echo)} {($ Id.VSub_DollarName '$FILE') (SQ (Token id:Id.Lit_Chars val:':' span_id:230)) } ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(cat)} {($ Id.VSub_DollarName '$FILE')}) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:240) ) ] ) ] ) ) (C {(test_cmp)} {(.cat_expect)} {(-)}) ] negated: F ) ] ) ] ) ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'reset --hard message' span_id:259))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:263) (Token id:Id.Lit_Chars val:'\thex=$(git log -1 --format="%h") &&\n' span_id:264) (Token id:Id.Lit_Chars val:'\tgit reset --hard > .actual &&\n' span_id:265) (Token id: Id.Lit_Chars val: '\techo HEAD is now at $hex $(commit_msg) > .expected &&\n' span_id: 266 ) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp .expected .actual\n' span_id:267) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'reset --hard message (ISO8859-1 logoutputencoding)' span_id: 274 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:278) (Token id:Id.Lit_Chars val:'\thex=$(git log -1 --format="%h") &&\n' span_id:279) (Token id: Id.Lit_Chars val: '\tgit -c "i18n.logOutputEncoding=$test_encoding" reset --hard > .actual &&\n' span_id: 280 ) (Token id: Id.Lit_Chars val: '\techo HEAD is now at $hex $(commit_msg $test_encoding) > .expected &&\n' span_id: 281 ) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp .expected .actual\n' span_id:282) ) } ) (command.Simple redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:286) fd: -1 arg_word: {(.diff_expect)} ) ] ) (command.Simple redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:289) fd: -1 arg_word: {(.cached_expect)} ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:294) fd: -1 arg_word: {(.cat_expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:297) fd: -1 here_begin: {(EOF)} here_end_span_id: 304 stdin_parts: [('secondfile:\n') ('1st line 2nd file\n') ('2nd line 2nd file\n')] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'giving a non existing revision should fail' span_id:309))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:313) (Token id:Id.Lit_Chars val:'\ttest_must_fail git reset aaaaaa &&\n' span_id:314) (Token id:Id.Lit_Chars val:'\ttest_must_fail git reset --mixed aaaaaa &&\n' span_id:315) (Token id: Id.Lit_Chars val: '\ttest_must_fail git reset --soft aaaaaa &&\n' span_id: 316 ) (Token id:Id.Lit_Chars val:'\ttest_must_fail git reset --hard aaaaaa &&\n' span_id:317) (Token id:Id.Lit_Chars val:'\tcheck_changes $head5\n' span_id:318) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'reset --soft with unmerged index should fail' span_id:325))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:329) (Token id:Id.Lit_Chars val:'\ttouch .git/MERGE_HEAD &&\n' span_id:330) (Token id: Id.Lit_Chars val: '\techo "100644 44c5b5884550c17758737edcced463447b91d42b 1\tun" |\n' span_id: 331 ) (Token id:Id.Lit_Chars val:'\t\tgit update-index --index-info &&\n' span_id:332) (Token id: Id.Lit_Chars val: '\ttest_must_fail git reset --soft HEAD &&\n' span_id: 333 ) (Token id:Id.Lit_Chars val:'\trm .git/MERGE_HEAD &&\n' span_id:334) (Token id:Id.Lit_Chars val:'\tgit rm --cached -- un\n' span_id:335) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'giving paths with options different than --mixed should fail' span_id: 344 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:348) (Token id: Id.Lit_Chars val: '\ttest_must_fail git reset --soft -- first &&\n' span_id: 349 ) (Token id:Id.Lit_Chars val:'\ttest_must_fail git reset --hard -- first &&\n' span_id:350) (Token id: Id.Lit_Chars val: '\ttest_must_fail git reset --soft HEAD^ -- first &&\n' span_id: 351 ) (Token id:Id.Lit_Chars val:'\ttest_must_fail git reset --hard HEAD^ -- first &&\n' span_id:352) (Token id:Id.Lit_Chars val:'\tcheck_changes $head5\n' span_id:353) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'giving unrecognized options should fail' span_id:360))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:364) (Token id:Id.Lit_Chars val:'\ttest_must_fail git reset --other &&\n' span_id:365) (Token id:Id.Lit_Chars val:'\ttest_must_fail git reset -o &&\n' span_id:366) (Token id: Id.Lit_Chars val: '\ttest_must_fail git reset --mixed --other &&\n' span_id: 367 ) (Token id:Id.Lit_Chars val:'\ttest_must_fail git reset --mixed -o &&\n' span_id:368) (Token id: Id.Lit_Chars val: '\ttest_must_fail git reset --soft --other &&\n' span_id: 369 ) (Token id:Id.Lit_Chars val:'\ttest_must_fail git reset --soft -o &&\n' span_id:370) (Token id: Id.Lit_Chars val: '\ttest_must_fail git reset --hard --other &&\n' span_id: 371 ) (Token id:Id.Lit_Chars val:'\ttest_must_fail git reset --hard -o &&\n' span_id:372) (Token id:Id.Lit_Chars val:'\tcheck_changes $head5\n' span_id:373) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'trying to do reset --soft with pending merge should fail' span_id: 382 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:386) (Token id:Id.Lit_Chars val:'\tgit branch branch1 &&\n' span_id:387) (Token id:Id.Lit_Chars val:'\tgit branch branch2 &&\n' span_id:388) (Token id:Id.Lit_Chars val:'\n' span_id:389) (Token id:Id.Lit_Chars val:'\tgit checkout branch1 &&\n' span_id:390) (Token id: Id.Lit_Chars val: '\techo "3rd line in branch1" >>secondfile &&\n' span_id: 391 ) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "change in branch1" &&\n' span_id:392) (Token id:Id.Lit_Chars val:'\n' span_id:393) (Token id:Id.Lit_Chars val:'\tgit checkout branch2 &&\n' span_id:394) (Token id: Id.Lit_Chars val: '\techo "3rd line in branch2" >>secondfile &&\n' span_id: 395 ) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "change in branch2" &&\n' span_id:396) (Token id:Id.Lit_Chars val:'\n' span_id:397) (Token id:Id.Lit_Chars val:'\ttest_must_fail git merge branch1 &&\n' span_id:398) (Token id:Id.Lit_Chars val:'\ttest_must_fail git reset --soft &&\n' span_id:399) (Token id:Id.Lit_Chars val:'\n' span_id:400) (Token id: Id.Lit_Chars val: '\tprintf "1st line 2nd file\\n2nd line 2nd file\\n3rd line" >secondfile &&\n' span_id: 401 ) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "the change in branch2" &&\n' span_id:402) (Token id:Id.Lit_Chars val:'\n' span_id:403) (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:404) (Token id:Id.Lit_Chars val:'\tgit branch -D branch1 branch2 &&\n' span_id:405) (Token id:Id.Lit_Chars val:'\tcheck_changes $head5\n' span_id:406) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'trying to do reset --soft with pending checkout merge should fail' span_id: 415 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:419) (Token id:Id.Lit_Chars val:'\tgit branch branch3 &&\n' span_id:420) (Token id:Id.Lit_Chars val:'\tgit branch branch4 &&\n' span_id:421) (Token id:Id.Lit_Chars val:'\n' span_id:422) (Token id:Id.Lit_Chars val:'\tgit checkout branch3 &&\n' span_id:423) (Token id: Id.Lit_Chars val: '\techo "3rd line in branch3" >>secondfile &&\n' span_id: 424 ) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "line in branch3" &&\n' span_id:425) (Token id:Id.Lit_Chars val:'\n' span_id:426) (Token id:Id.Lit_Chars val:'\tgit checkout branch4 &&\n' span_id:427) (Token id: Id.Lit_Chars val: '\techo "3rd line in branch4" >>secondfile &&\n' span_id: 428 ) (Token id:Id.Lit_Chars val:'\n' span_id:429) (Token id:Id.Lit_Chars val:'\tgit checkout -m branch3 &&\n' span_id:430) (Token id:Id.Lit_Chars val:'\ttest_must_fail git reset --soft &&\n' span_id:431) (Token id:Id.Lit_Chars val:'\n' span_id:432) (Token id: Id.Lit_Chars val: '\tprintf "1st line 2nd file\\n2nd line 2nd file\\n3rd line" >secondfile &&\n' span_id: 433 ) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "the line in branch3" &&\n' span_id:434) (Token id:Id.Lit_Chars val:'\n' span_id:435) (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:436) (Token id:Id.Lit_Chars val:'\tgit branch -D branch3 branch4 &&\n' span_id:437) (Token id:Id.Lit_Chars val:'\tcheck_changes $head5\n' span_id:438) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'resetting to HEAD with no changes should succeed and do nothing' span_id: 447 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:451) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:452) (Token id:Id.Lit_Chars val:'\t\tcheck_changes $head5 &&\n' span_id:453) (Token id:Id.Lit_Chars val:'\tgit reset --hard HEAD &&\n' span_id:454) (Token id:Id.Lit_Chars val:'\t\tcheck_changes $head5 &&\n' span_id:455) (Token id:Id.Lit_Chars val:'\tgit reset --soft &&\n' span_id:456) (Token id:Id.Lit_Chars val:'\t\tcheck_changes $head5 &&\n' span_id:457) (Token id:Id.Lit_Chars val:'\tgit reset --soft HEAD &&\n' span_id:458) (Token id:Id.Lit_Chars val:'\t\tcheck_changes $head5 &&\n' span_id:459) (Token id:Id.Lit_Chars val:'\tgit reset --mixed &&\n' span_id:460) (Token id:Id.Lit_Chars val:'\t\tcheck_changes $head5 &&\n' span_id:461) (Token id:Id.Lit_Chars val:'\tgit reset --mixed HEAD &&\n' span_id:462) (Token id:Id.Lit_Chars val:'\t\tcheck_changes $head5 &&\n' span_id:463) (Token id:Id.Lit_Chars val:'\tgit reset &&\n' span_id:464) (Token id:Id.Lit_Chars val:'\t\tcheck_changes $head5 &&\n' span_id:465) (Token id:Id.Lit_Chars val:'\tgit reset HEAD &&\n' span_id:466) (Token id:Id.Lit_Chars val:'\t\tcheck_changes $head5\n' span_id:467) ) } ) (command.Simple redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:471) fd: -1 arg_word: {(.diff_expect)} ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:476) fd: -1 arg_word: {(.cached_expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:479) fd: -1 here_begin: {(EOF)} here_end_span_id: 491 stdin_parts: [ ('diff --git a/secondfile b/secondfile\n') ('index 1bbba79..44c5b58 100644\n') ('--- a/secondfile\n') ('+++ b/secondfile\n') ('@@ -1 +1,2 @@\n') ('-2nd file\n') ('+1st line 2nd file\n') ('+2nd line 2nd file\n') ] ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:494) fd: -1 arg_word: {(.cat_expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:497) fd: -1 here_begin: {(EOF)} here_end_span_id: 504 stdin_parts: [('secondfile:\n') ('1st line 2nd file\n') ('2nd line 2nd file\n')] ) ] ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '--soft reset only should show changes in diff --cached' span_id: 508 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:512) (Token id:Id.Lit_Chars val:'\tgit reset --soft HEAD^ &&\n' span_id:513) (Token id: Id.Lit_Chars val: '\tcheck_changes d1a4bc3abce4829628ae2dcb0d60ef3d1a78b1c4 &&\n' span_id: 514 ) (Token id:Id.Lit_Chars val:'\ttest "$(git rev-parse ORIG_HEAD)" = \\\n' span_id:515) (Token id:Id.Lit_Chars val:'\t\t\t$head5\n' span_id:516) ) } ) (command.Simple redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:520) fd: -1 arg_word: {(.diff_expect)} ) ] ) (command.Simple redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:523) fd: -1 arg_word: {(.cached_expect)} ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:528) fd: -1 arg_word: {(.cat_expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:531) fd: -1 here_begin: {(EOF)} here_end_span_id: 539 stdin_parts: [ ('secondfile:\n') ('1st line 2nd file\n') ('2nd line 2nd file\n') ('3rd line 2nd file\n') ] ) ] ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'changing files and redo the last commit should succeed' span_id: 545 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:549) (Token id: Id.Lit_Chars val: '\techo "3rd line 2nd file" >>secondfile &&\n' span_id: 550 ) (Token id:Id.Lit_Chars val:'\tgit commit -a -C ORIG_HEAD &&\n' span_id:551) (Token id: Id.Lit_Chars val: '\thead4=$(git rev-parse --verify HEAD) &&\n' span_id: 552 ) (Token id:Id.Lit_Chars val:'\tcheck_changes $head4 &&\n' span_id:553) (Token id: Id.Lit_Chars val: '\ttest "$(git rev-parse ORIG_HEAD)" = \\\n' span_id: 554 ) (Token id:Id.Lit_Chars val:'\t\t\t$head5\n' span_id:555) ) } ) (command.Simple redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:559) fd: -1 arg_word: {(.diff_expect)} ) ] ) (command.Simple redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:562) fd: -1 arg_word: {(.cached_expect)} ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:567) fd: -1 arg_word: {(.cat_expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:570) fd: -1 here_begin: {(EOF)} here_end_span_id: 579 stdin_parts: [('first:\n') ('1st file\n') ('2nd line 1st file\n') ('second:\n') ('2nd file\n')] ) ] ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '--hard reset should change the files and undo commits permanently' span_id: 585 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:589) (Token id:Id.Lit_Chars val:'\tgit reset --hard HEAD~2 &&\n' span_id:590) (Token id: Id.Lit_Chars val: '\tcheck_changes ddaefe00f1da16864591c61fdc7adb5d7cd6b74e &&\n' span_id: 591 ) (Token id:Id.Lit_Chars val:'\ttest "$(git rev-parse ORIG_HEAD)" = \\\n' span_id:592) (Token id:Id.Lit_Chars val:'\t\t\t$head4\n' span_id:593) ) } ) (command.Simple redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:597) fd: -1 arg_word: {(.diff_expect)} ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:602) fd: -1 arg_word: {(.cached_expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:605) fd: -1 here_begin: {(EOF)} here_end_span_id: 632 stdin_parts: [ ('diff --git a/first b/first\n') ('deleted file mode 100644\n') ('index 8206c22..0000000\n') ('--- a/first\n') ('+++ /dev/null\n') ('@@ -1,2 +0,0 @@\n') ('-1st file\n') ('-2nd line 1st file\n') ('diff --git a/second b/second\n') ('deleted file mode 100644\n') ('index 1bbba79..0000000\n') ('--- a/second\n') ('+++ /dev/null\n') ('@@ -1 +0,0 @@\n') ('-2nd file\n') ('diff --git a/secondfile b/secondfile\n') ('new file mode 100644\n') ('index 0000000..44c5b58\n') ('--- /dev/null\n') ('+++ b/secondfile\n') ('@@ -0,0 +1,2 @@\n') ('+1st line 2nd file\n') ('+2nd line 2nd file\n') ] ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:635) fd: -1 arg_word: {(.cat_expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:638) fd: -1 here_begin: {(EOF)} here_end_span_id: 645 stdin_parts: [('secondfile:\n') ('1st line 2nd file\n') ('2nd line 2nd file\n')] ) ] ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'redoing changes adding them without commit them should succeed' span_id: 651 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:655) (Token id:Id.Lit_Chars val:'\tgit rm first &&\n' span_id:656) (Token id:Id.Lit_Chars val:'\tgit mv second secondfile &&\n' span_id:657) (Token id:Id.Lit_Chars val:'\n' span_id:658) (Token id:Id.Lit_Chars val:'\techo "1st line 2nd file" >secondfile &&\n' span_id:659) (Token id: Id.Lit_Chars val: '\techo "2nd line 2nd file" >>secondfile &&\n' span_id: 660 ) (Token id:Id.Lit_Chars val:'\tgit add secondfile &&\n' span_id:661) (Token id: Id.Lit_Chars val: '\tcheck_changes ddaefe00f1da16864591c61fdc7adb5d7cd6b74e\n' span_id: 662 ) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:668) fd: -1 arg_word: {(.diff_expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:671) fd: -1 here_begin: {(EOF)} here_end_span_id: 690 stdin_parts: [ ('diff --git a/first b/first\n') ('deleted file mode 100644\n') ('index 8206c22..0000000\n') ('--- a/first\n') ('+++ /dev/null\n') ('@@ -1,2 +0,0 @@\n') ('-1st file\n') ('-2nd line 1st file\n') ('diff --git a/second b/second\n') ('deleted file mode 100644\n') ('index 1bbba79..0000000\n') ('--- a/second\n') ('+++ /dev/null\n') ('@@ -1 +0,0 @@\n') ('-2nd file\n') ] ) ] ) (command.Simple redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:691) fd: -1 arg_word: {(.cached_expect)} ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:696) fd: -1 arg_word: {(.cat_expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:699) fd: -1 here_begin: {(EOF)} here_end_span_id: 706 stdin_parts: [('secondfile:\n') ('1st line 2nd file\n') ('2nd line 2nd file\n')] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'--mixed reset to HEAD should unadd the files' span_id:710))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:714) (Token id:Id.Lit_Chars val:'\tgit reset &&\n' span_id:715) (Token id: Id.Lit_Chars val: '\tcheck_changes ddaefe00f1da16864591c61fdc7adb5d7cd6b74e &&\n' span_id: 716 ) (Token id:Id.Lit_Chars val:'\ttest "$(git rev-parse ORIG_HEAD)" = \\\n' span_id:717) (Token id: Id.Lit_Chars val: '\t\t\tddaefe00f1da16864591c61fdc7adb5d7cd6b74e\n' span_id: 718 ) ) } ) (command.Simple redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:722) fd: -1 arg_word: {(.diff_expect)} ) ] ) (command.Simple redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:725) fd: -1 arg_word: {(.cached_expect)} ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:730) fd: -1 arg_word: {(.cat_expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:733) fd: -1 here_begin: {(EOF)} here_end_span_id: 740 stdin_parts: [('secondfile:\n') ('1st line 2nd file\n') ('2nd line 2nd file\n')] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'redoing the last two commits should succeed' span_id:744))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:748) (Token id:Id.Lit_Chars val:'\tgit add secondfile &&\n' span_id:749) (Token id: Id.Lit_Chars val: '\tgit reset --hard ddaefe00f1da16864591c61fdc7adb5d7cd6b74e &&\n' span_id: 750 ) (Token id:Id.Lit_Chars val:'\n' span_id:751) (Token id:Id.Lit_Chars val:'\tgit rm first &&\n' span_id:752) (Token id:Id.Lit_Chars val:'\tgit mv second secondfile &&\n' span_id:753) (Token id: Id.Lit_Chars val: '\tgit commit -a -m "remove 1st and rename 2nd" &&\n' span_id: 754 ) (Token id:Id.Lit_Chars val:'\n' span_id:755) (Token id: Id.Lit_Chars val: '\techo "1st line 2nd file" >secondfile &&\n' span_id: 756 ) (Token id:Id.Lit_Chars val:'\techo "2nd line 2nd file" >>secondfile &&\n' span_id:757) (Token id: Id.Lit_Chars val: '\t# "git commit -m" would break MinGW, as Windows refuse to pass\n' span_id: 758 ) (Token id:Id.Lit_Chars val:'\t# $test_encoding encoded parameter to git.\n' span_id:759) (Token id: Id.Lit_Chars val: '\tcommit_msg $test_encoding | git -c "i18n.commitEncoding=$test_encoding" commit -a -F - &&\n' span_id: 760 ) (Token id:Id.Lit_Chars val:'\tcheck_changes $head5\n' span_id:761) ) } ) (command.Simple redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:765) fd: -1 arg_word: {(.diff_expect)} ) ] ) (command.Simple redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:768) fd: -1 arg_word: {(.cached_expect)} ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:773) fd: -1 arg_word: {(.cat_expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:776) fd: -1 here_begin: {(EOF)} here_end_span_id: 784 stdin_parts: [ ('secondfile:\n') ('1st line 2nd file\n') ('2nd line 2nd file\n') ('3rd line in branch2\n') ] ) ] ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '--hard reset to HEAD should clear a failed merge' span_id: 788 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:792) (Token id:Id.Lit_Chars val:'\tgit branch branch1 &&\n' span_id:793) (Token id:Id.Lit_Chars val:'\tgit branch branch2 &&\n' span_id:794) (Token id:Id.Lit_Chars val:'\n' span_id:795) (Token id:Id.Lit_Chars val:'\tgit checkout branch1 &&\n' span_id:796) (Token id: Id.Lit_Chars val: '\techo "3rd line in branch1" >>secondfile &&\n' span_id: 797 ) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "change in branch1" &&\n' span_id:798) (Token id:Id.Lit_Chars val:'\n' span_id:799) (Token id:Id.Lit_Chars val:'\tgit checkout branch2 &&\n' span_id:800) (Token id: Id.Lit_Chars val: '\techo "3rd line in branch2" >>secondfile &&\n' span_id: 801 ) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "change in branch2" &&\n' span_id:802) (Token id: Id.Lit_Chars val: '\thead3=$(git rev-parse --verify HEAD) &&\n' span_id: 803 ) (Token id:Id.Lit_Chars val:'\n' span_id:804) (Token id: Id.Lit_Chars val: '\ttest_must_fail git pull . branch1 &&\n' span_id: 805 ) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:806) (Token id:Id.Lit_Chars val:'\tcheck_changes $head3\n' span_id:807) ) } ) (command.Simple redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:811) fd: -1 arg_word: {(.diff_expect)} ) ] ) (command.Simple redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:814) fd: -1 arg_word: {(.cached_expect)} ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:819) fd: -1 arg_word: {(.cat_expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:822) fd: -1 here_begin: {(EOF)} here_end_span_id: 829 stdin_parts: [('secondfile:\n') ('1st line 2nd file\n') ('2nd line 2nd file\n')] ) ] ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '--hard reset to ORIG_HEAD should clear a fast-forward merge' span_id: 835 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:839) (Token id:Id.Lit_Chars val:'\tgit reset --hard HEAD^ &&\n' span_id:840) (Token id:Id.Lit_Chars val:'\tcheck_changes $head5 &&\n' span_id:841) (Token id:Id.Lit_Chars val:'\n' span_id:842) (Token id:Id.Lit_Chars val:'\tgit pull . branch1 &&\n' span_id:843) (Token id:Id.Lit_Chars val:'\tgit reset --hard ORIG_HEAD &&\n' span_id:844) (Token id:Id.Lit_Chars val:'\tcheck_changes $head5 &&\n' span_id:845) (Token id:Id.Lit_Chars val:'\n' span_id:846) (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:847) (Token id:Id.Lit_Chars val:'\tgit branch -D branch1 branch2 &&\n' span_id:848) (Token id:Id.Lit_Chars val:'\tcheck_changes $head5\n' span_id:849) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:855) fd: -1 arg_word: {(expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:859) fd: -1 here_begin: {(EOF)} here_end_span_id: 878 stdin_parts: [ ('diff --git a/file1 b/file1\n') ('index d00491f..7ed6ff8 100644\n') ('--- a/file1\n') ('+++ b/file1\n') ('@@ -1 +1 @@\n') ('-1\n') ('+5\n') ('diff --git a/file2 b/file2\n') ('deleted file mode 100644\n') ('index 0cfbf08..0000000\n') ('--- a/file2\n') ('+++ /dev/null\n') ('@@ -1 +0,0 @@\n') ('-2\n') ] ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:881) fd: -1 arg_word: {(cached_expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:885) fd: -1 here_begin: {(EOF)} here_end_span_id: 897 stdin_parts: [ ('diff --git a/file4 b/file4\n') ('new file mode 100644\n') ('index 0000000..b8626c4\n') ('--- /dev/null\n') ('+++ b/file4\n') ('@@ -0,0 +1 @@\n') ('+4\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'test --mixed <paths>' span_id:901))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:905) (Token id:Id.Lit_Chars val:'\techo 1 > file1 &&\n' span_id:906) (Token id:Id.Lit_Chars val:'\techo 2 > file2 &&\n' span_id:907) (Token id:Id.Lit_Chars val:'\tgit add file1 file2 &&\n' span_id:908) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:909) (Token id:Id.Lit_Chars val:'\tgit commit -m files &&\n' span_id:910) (Token id:Id.Lit_Chars val:'\tgit rm file2 &&\n' span_id:911) (Token id:Id.Lit_Chars val:'\techo 3 > file3 &&\n' span_id:912) (Token id:Id.Lit_Chars val:'\techo 4 > file4 &&\n' span_id:913) (Token id:Id.Lit_Chars val:'\techo 5 > file1 &&\n' span_id:914) (Token id:Id.Lit_Chars val:'\tgit add file1 file3 file4 &&\n' span_id:915) (Token id: Id.Lit_Chars val: '\tgit reset HEAD -- file1 file2 file3 &&\n' span_id: 916 ) (Token id:Id.Lit_Chars val:'\ttest_must_fail git diff --quiet &&\n' span_id:917) (Token id:Id.Lit_Chars val:'\tgit diff > output &&\n' span_id:918) (Token id:Id.Lit_Chars val:'\ttest_cmp output expect &&\n' span_id:919) (Token id:Id.Lit_Chars val:'\tgit diff --cached > output &&\n' span_id:920) (Token id:Id.Lit_Chars val:'\ttest_cmp output cached_expect\n' span_id:921) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'test resetting the index at give paths' span_id:928))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:932) (Token id:Id.Lit_Chars val:'\n' span_id:933) (Token id:Id.Lit_Chars val:'\tmkdir sub &&\n' span_id:934) (Token id:Id.Lit_Chars val:'\t>sub/file1 &&\n' span_id:935) (Token id:Id.Lit_Chars val:'\t>sub/file2 &&\n' span_id:936) (Token id:Id.Lit_Chars val:'\tgit update-index --add sub/file1 sub/file2 &&\n' span_id:937) (Token id:Id.Lit_Chars val:'\tT=$(git write-tree) &&\n' span_id:938) (Token id:Id.Lit_Chars val:'\tgit reset HEAD sub/file2 &&\n' span_id:939) (Token id:Id.Lit_Chars val:'\ttest_must_fail git diff --quiet &&\n' span_id:940) (Token id:Id.Lit_Chars val:'\tU=$(git write-tree) &&\n' span_id:941) (Token id:Id.Lit_Chars val:'\techo "$T" &&\n' span_id:942) (Token id:Id.Lit_Chars val:'\techo "$U" &&\n' span_id:943) (Token id: Id.Lit_Chars val: '\ttest_must_fail git diff-index --cached --exit-code "$T" &&\n' span_id: 944 ) (Token id:Id.Lit_Chars val:'\ttest "$T" != "$U"\n' span_id:945) (Token id:Id.Lit_Chars val:'\n' span_id:946) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'resetting an unmodified path is a no-op' span_id:953))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:957) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:958) (Token id:Id.Lit_Chars val:'\tgit reset -- file1 &&\n' span_id:959) (Token id:Id.Lit_Chars val:'\tgit diff-files --exit-code &&\n' span_id:960) (Token id:Id.Lit_Chars val:'\tgit diff-index --cached --exit-code HEAD\n' span_id:961) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:967) fd: -1 arg_word: {(expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:971) fd: -1 here_begin: {(EOF)} here_end_span_id: 978 stdin_parts: [('Unstaged changes after reset:\n') ('M\tfile2\n')] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'--mixed refreshes the index' span_id:983))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:987) (Token id:Id.Lit_Chars val:'\techo 123 >> file2 &&\n' span_id:988) (Token id:Id.Lit_Chars val:'\tgit reset --mixed HEAD > output &&\n' span_id:989) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expect output\n' span_id:990) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'resetting specific path that is unmerged' span_id:997))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1001) (Token id:Id.Lit_Chars val:'\tgit rm --cached file2 &&\n' span_id:1002) (Token id:Id.Lit_Chars val:'\tF1=$(git rev-parse HEAD:file1) &&\n' span_id:1003) (Token id:Id.Lit_Chars val:'\tF2=$(git rev-parse HEAD:file2) &&\n' span_id:1004) (Token id:Id.Lit_Chars val:'\tF3=$(git rev-parse HEAD:secondfile) &&\n' span_id:1005) (Token id:Id.Lit_Chars val:'\t{\n' span_id:1006) (Token id:Id.Lit_Chars val:'\t\techo "100644 $F1 1\tfile2" &&\n' span_id:1007) (Token id:Id.Lit_Chars val:'\t\techo "100644 $F2 2\tfile2" &&\n' span_id:1008) (Token id:Id.Lit_Chars val:'\t\techo "100644 $F3 3\tfile2"\n' span_id:1009) (Token id: Id.Lit_Chars val: '\t} | git update-index --index-info &&\n' span_id: 1010 ) (Token id:Id.Lit_Chars val:'\tgit ls-files -u &&\n' span_id:1011) (Token id:Id.Lit_Chars val:'\tgit reset HEAD file2 &&\n' span_id:1012) (Token id:Id.Lit_Chars val:'\ttest_must_fail git diff --quiet &&\n' span_id:1013) (Token id: Id.Lit_Chars val: '\tgit diff-index --exit-code --cached HEAD\n' span_id: 1014 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'disambiguation (1)' span_id:1021))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1025) (Token id:Id.Lit_Chars val:'\n' span_id:1026) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:1027) (Token id:Id.Lit_Chars val:'\t>secondfile &&\n' span_id:1028) (Token id:Id.Lit_Chars val:'\tgit add secondfile &&\n' span_id:1029) (Token id:Id.Lit_Chars val:'\tgit reset secondfile &&\n' span_id:1030) (Token id:Id.Lit_Chars val:'\ttest_must_fail git diff --quiet -- secondfile &&\n' span_id:1031) (Token id: Id.Lit_Chars val: '\ttest -z "$(git diff --cached --name-only)" &&\n' span_id: 1032 ) (Token id:Id.Lit_Chars val:'\ttest -f secondfile &&\n' span_id:1033) (Token id:Id.Lit_Chars val:'\ttest_must_be_empty secondfile\n' span_id:1034) (Token id:Id.Lit_Chars val:'\n' span_id:1035) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'disambiguation (2)' span_id:1042))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1046) (Token id:Id.Lit_Chars val:'\n' span_id:1047) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:1048) (Token id:Id.Lit_Chars val:'\t>secondfile &&\n' span_id:1049) (Token id:Id.Lit_Chars val:'\tgit add secondfile &&\n' span_id:1050) (Token id:Id.Lit_Chars val:'\trm -f secondfile &&\n' span_id:1051) (Token id:Id.Lit_Chars val:'\ttest_must_fail git reset secondfile &&\n' span_id:1052) (Token id: Id.Lit_Chars val: '\ttest -n "$(git diff --cached --name-only -- secondfile)" &&\n' span_id: 1053 ) (Token id:Id.Lit_Chars val:'\ttest ! -f secondfile\n' span_id:1054) (Token id:Id.Lit_Chars val:'\n' span_id:1055) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'disambiguation (3)' span_id:1062))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1066) (Token id:Id.Lit_Chars val:'\n' span_id:1067) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:1068) (Token id:Id.Lit_Chars val:'\t>secondfile &&\n' span_id:1069) (Token id:Id.Lit_Chars val:'\tgit add secondfile &&\n' span_id:1070) (Token id:Id.Lit_Chars val:'\trm -f secondfile &&\n' span_id:1071) (Token id:Id.Lit_Chars val:'\tgit reset HEAD secondfile &&\n' span_id:1072) (Token id:Id.Lit_Chars val:'\ttest_must_fail git diff --quiet &&\n' span_id:1073) (Token id:Id.Lit_Chars val:'\ttest -z "$(git diff --cached --name-only)" &&\n' span_id:1074) (Token id:Id.Lit_Chars val:'\ttest ! -f secondfile\n' span_id:1075) (Token id:Id.Lit_Chars val:'\n' span_id:1076) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'disambiguation (4)' span_id:1083))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1087) (Token id:Id.Lit_Chars val:'\n' span_id:1088) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:1089) (Token id:Id.Lit_Chars val:'\t>secondfile &&\n' span_id:1090) (Token id:Id.Lit_Chars val:'\tgit add secondfile &&\n' span_id:1091) (Token id:Id.Lit_Chars val:'\trm -f secondfile &&\n' span_id:1092) (Token id:Id.Lit_Chars val:'\tgit reset -- secondfile &&\n' span_id:1093) (Token id:Id.Lit_Chars val:'\ttest_must_fail git diff --quiet &&\n' span_id:1094) (Token id:Id.Lit_Chars val:'\ttest -z "$(git diff --cached --name-only)" &&\n' span_id:1095) (Token id:Id.Lit_Chars val:'\ttest ! -f secondfile\n' span_id:1096) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'reset with paths accepts tree' span_id:1103))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1107) (Token id: Id.Lit_Chars val: '\t# for simpler tests, drop last commit containing added files\n' span_id: 1108 ) (Token id:Id.Lit_Chars val:'\tgit reset --hard HEAD^ &&\n' span_id:1109) (Token id:Id.Lit_Chars val:'\tgit reset HEAD^^{tree} -- . &&\n' span_id:1110) (Token id:Id.Lit_Chars val:'\tgit diff --cached HEAD^ --exit-code &&\n' span_id:1111) (Token id:Id.Lit_Chars val:'\tgit diff HEAD --exit-code\n' span_id:1112) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'reset -N keeps removed files as intent-to-add' span_id:1119))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1123) (Token id:Id.Lit_Chars val:'\techo new-file >new-file &&\n' span_id:1124) (Token id:Id.Lit_Chars val:'\tgit add new-file &&\n' span_id:1125) (Token id:Id.Lit_Chars val:'\tgit reset -N HEAD &&\n' span_id:1126) (Token id:Id.Lit_Chars val:'\n' span_id:1127) (Token id:Id.Lit_Chars val:'\ttree=$(git write-tree) &&\n' span_id:1128) (Token id:Id.Lit_Chars val:'\tgit ls-tree $tree new-file >actual &&\n' span_id:1129) (Token id:Id.Lit_Chars val:'\t>expect &&\n' span_id:1130) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual &&\n' span_id:1131) (Token id:Id.Lit_Chars val:'\n' span_id:1132) (Token id:Id.Lit_Chars val:'\tgit diff --name-only >actual &&\n' span_id:1133) (Token id:Id.Lit_Chars val:'\techo new-file >expect &&\n' span_id:1134) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1135) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'reset --mixed sets up work tree' span_id:1142))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1146) (Token id:Id.Lit_Chars val:'\tgit init mixed_worktree &&\n' span_id:1147) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1148) (Token id:Id.Lit_Chars val:'\t\tcd mixed_worktree &&\n' span_id:1149) (Token id:Id.Lit_Chars val:'\t\ttest_commit dummy\n' span_id:1150) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1151) (Token id:Id.Lit_Chars val:'\t: >expect &&\n' span_id:1152) (Token id: Id.Lit_Chars val: '\tgit --git-dir=mixed_worktree/.git --work-tree=mixed_worktree reset >actual &&\n' span_id: 1153 ) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1154) ) } ) (C {(test_done)}) ] )