(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:'skip-worktree bit test' span_id:15))} spids: [13] ) ] ) (C {(.)} {(./test-lib.sh)}) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:26) fd: -1 arg_word: {(expect.full)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:29) fd: -1 here_begin: {(EOF)} here_end_span_id: 38 stdin_parts: [('H 1\n') ('H 2\n') ('H init.t\n') ('H sub/1\n') ('H sub/2\n')] ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:42) fd: -1 arg_word: {(expect.skip)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:45) fd: -1 here_begin: {(EOF)} here_end_span_id: 54 stdin_parts: [('S 1\n') ('H 2\n') ('H init.t\n') ('S sub/1\n') ('H sub/2\n')] ) ] ) (command.ShFunction name: setup_absent body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp] children: [(C {(test)} {(-f)} {(1)}) (C {(rm)} {(1)})] ) (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (C {(git)} {(update-index)} {(--remove)} {(1)}) (C {(git)} {(update-index)} {(--add)} {(--cacheinfo)} {(100644)} {($ Id.VSub_DollarName '$EMPTY_BLOB')} {(1)} ) (C {(git)} {(update-index)} {(--skip-worktree)} {(1)}) ] ) ] ) ) (command.ShFunction name: test_absent body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (command.Simple words: [{(echo)} {(DQ ('100644 ') ($ Id.VSub_DollarName '$EMPTY_BLOB') (' 0\t1'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:130) fd: -1 arg_word: {(expected)} ) ] ) (command.Simple words: [{(git)} {(ls-files)} {(--stage)} {(1)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:145) fd: -1 arg_word: {(result)} ) ] ) (C {(test_cmp)} {(expected)} {(result)}) (C {(test)} {(Id.KW_Bang '!')} {(-f)} {(1)}) ] ) ] ) ) (command.ShFunction name: setup_dirty body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (C {(git)} {(update-index)} {(--force-remove)} {(1)}) (command.Simple words: [{(echo)} {(dirty)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:194) fd: -1 arg_word: {(1)} ) ] ) (C {(git)} {(update-index)} {(--add)} {(--cacheinfo)} {(100644)} {($ Id.VSub_DollarName '$EMPTY_BLOB')} {(1)} ) (C {(git)} {(update-index)} {(--skip-worktree)} {(1)}) ] ) ] ) ) (command.ShFunction name: test_dirty body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (command.Simple words: [{(echo)} {(DQ ('100644 ') ($ Id.VSub_DollarName '$EMPTY_BLOB') (' 0\t1'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:244) fd: -1 arg_word: {(expected)} ) ] ) (command.Simple words: [{(git)} {(ls-files)} {(--stage)} {(1)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:259) fd: -1 arg_word: {(result)} ) ] ) (C {(test_cmp)} {(expected)} {(result)}) (command.Simple words: [{(echo)} {(dirty)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:279) fd: -1 arg_word: {(expected)} ) ] ) ] ) (C {(test_cmp)} {(expected)} {(1)}) ] ) ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:setup span_id:296))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:300) (Token id:Id.Lit_Chars val:'\ttest_commit init &&\n' span_id:301) (Token id:Id.Lit_Chars val:'\tmkdir sub &&\n' span_id:302) (Token id:Id.Lit_Chars val:'\ttouch ./1 ./2 sub/1 sub/2 &&\n' span_id:303) (Token id:Id.Lit_Chars val:'\tgit add 1 2 sub/1 sub/2 &&\n' span_id:304) (Token id: Id.Lit_Chars val: '\tgit update-index --skip-worktree 1 sub/1 &&\n' span_id: 305 ) (Token id:Id.Lit_Chars val:'\tgit ls-files -t > result &&\n' span_id:306) (Token id:Id.Lit_Chars val:'\ttest_cmp expect.skip result\n' span_id:307) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:update-index span_id:314))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:318) (Token id:Id.Lit_Chars val:'\tsetup_absent &&\n' span_id:319) (Token id:Id.Lit_Chars val:'\tgit update-index 1 &&\n' span_id:320) (Token id:Id.Lit_Chars val:'\ttest_absent\n' span_id:321) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:update-index span_id:328))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:332) (Token id:Id.Lit_Chars val:'\tsetup_dirty &&\n' span_id:333) (Token id:Id.Lit_Chars val:'\tgit update-index 1 &&\n' span_id:334) (Token id:Id.Lit_Chars val:'\ttest_dirty\n' span_id:335) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'update-index --remove' span_id:342))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:346) (Token id:Id.Lit_Chars val:'\tsetup_absent &&\n' span_id:347) (Token id:Id.Lit_Chars val:'\tgit update-index --remove 1 &&\n' span_id:348) (Token id:Id.Lit_Chars val:'\ttest -z "$(git ls-files 1)" &&\n' span_id:349) (Token id:Id.Lit_Chars val:'\ttest ! -f 1\n' span_id:350) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'update-index --remove' span_id:357))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:361) (Token id:Id.Lit_Chars val:'\tsetup_dirty &&\n' span_id:362) (Token id:Id.Lit_Chars val:'\tgit update-index --remove 1 &&\n' span_id:363) (Token id:Id.Lit_Chars val:'\ttest -z "$(git ls-files 1)" &&\n' span_id:364) (Token id:Id.Lit_Chars val:'\techo dirty > expected &&\n' span_id:365) (Token id:Id.Lit_Chars val:'\ttest_cmp expected 1\n' span_id:366) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-files --deleted' span_id:373))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:377) (Token id:Id.Lit_Chars val:'\tsetup_absent &&\n' span_id:378) (Token id:Id.Lit_Chars val:'\ttest -z "$(git ls-files -d)"\n' span_id:379) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-files --deleted' span_id:386))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:390) (Token id:Id.Lit_Chars val:'\tsetup_dirty &&\n' span_id:391) (Token id:Id.Lit_Chars val:'\ttest -z "$(git ls-files -d)"\n' span_id:392) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-files --modified' span_id:399))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:403) (Token id:Id.Lit_Chars val:'\tsetup_absent &&\n' span_id:404) (Token id:Id.Lit_Chars val:'\ttest -z "$(git ls-files -m)"\n' span_id:405) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-files --modified' span_id:412))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:416) (Token id:Id.Lit_Chars val:'\tsetup_dirty &&\n' span_id:417) (Token id:Id.Lit_Chars val:'\ttest -z "$(git ls-files -m)"\n' span_id:418) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'grep with skip-worktree file' span_id:425))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:429) (Token id: Id.Lit_Chars val: '\tgit update-index --no-skip-worktree 1 &&\n' span_id: 430 ) (Token id:Id.Lit_Chars val:'\techo test > 1 &&\n' span_id:431) (Token id:Id.Lit_Chars val:'\tgit update-index 1 &&\n' span_id:432) (Token id:Id.Lit_Chars val:'\tgit update-index --skip-worktree 1 &&\n' span_id:433) (Token id:Id.Lit_Chars val:'\trm 1 &&\n' span_id:434) (Token id:Id.Lit_Chars val:'\ttest "$(git grep --no-ext-grep test)" = "1:test"\n' span_id:435) ) } ) (command.Simple words: [ {(echo)} { (DQ (':000000 100644 ') ($ Id.VSub_DollarName '$_z40') (' ') ($ Id.VSub_DollarName '$EMPTY_BLOB') (' A\t1') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:449) fd: -1 arg_word: {(expected)} ) ] ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'diff-index does not examine skip-worktree absent entries' span_id: 456 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:460) (Token id:Id.Lit_Chars val:'\tsetup_absent &&\n' span_id:461) (Token id:Id.Lit_Chars val:'\tgit diff-index HEAD -- 1 > result &&\n' span_id:462) (Token id:Id.Lit_Chars val:'\ttest_cmp expected result\n' span_id:463) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'diff-index does not examine skip-worktree dirty entries' span_id: 470 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:474) (Token id:Id.Lit_Chars val:'\tsetup_dirty &&\n' span_id:475) (Token id:Id.Lit_Chars val:'\tgit diff-index HEAD -- 1 > result &&\n' span_id:476) (Token id:Id.Lit_Chars val:'\ttest_cmp expected result\n' span_id:477) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'diff-files does not examine skip-worktree absent entries' span_id: 484 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:488) (Token id:Id.Lit_Chars val:'\tsetup_absent &&\n' span_id:489) (Token id:Id.Lit_Chars val:'\ttest -z "$(git diff-files -- one)"\n' span_id:490) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'diff-files does not examine skip-worktree dirty entries' span_id: 497 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:501) (Token id:Id.Lit_Chars val:'\tsetup_dirty &&\n' span_id:502) (Token id:Id.Lit_Chars val:'\ttest -z "$(git diff-files -- one)"\n' span_id:503) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git-rm succeeds on skip-worktree absent entries' span_id:510))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:514) (Token id:Id.Lit_Chars val:'\tsetup_absent &&\n' span_id:515) (Token id:Id.Lit_Chars val:'\tgit rm 1\n' span_id:516) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'commit on skip-worktree absent entries' span_id:523))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:527) (Token id:Id.Lit_Chars val:'\tgit reset &&\n' span_id:528) (Token id:Id.Lit_Chars val:'\tsetup_absent &&\n' span_id:529) (Token id:Id.Lit_Chars val:'\ttest_must_fail git commit -m null 1\n' span_id:530) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'commit on skip-worktree dirty entries' span_id:537))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:541) (Token id:Id.Lit_Chars val:'\tgit reset &&\n' span_id:542) (Token id:Id.Lit_Chars val:'\tsetup_dirty &&\n' span_id:543) (Token id:Id.Lit_Chars val:'\ttest_must_fail git commit -m null 1\n' span_id:544) ) } ) (C {(test_done)}) ] )