(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 <'skip-worktree bit test'>)} spids: [13] ) ] redirects: [] ) (C {<.>} {<'./test-lib.sh'>}) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect.full>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc 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'>] ) ) ] more_env: [] do_fork: T ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect.skip>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc 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'>] ) ) ] more_env: [] do_fork: T ) (command.ShFunction name: setup_absent body: (BraceGroup left: <Id.Lit_LBrace '{'> 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>}) ] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name: test_absent body: (BraceGroup left: <Id.Lit_LBrace '{'> 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 op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>})] more_env: [] do_fork: T ) (command.Simple words: [{<git>} {<ls-files>} {<--stage>} {<1>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<result>})] more_env: [] do_fork: T ) (C {<test_cmp>} {<expected>} {<result>}) (C {<test>} {<Id.KW_Bang '!'>} {<-f>} {<1>}) ] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name: setup_dirty body: (BraceGroup left: <Id.Lit_LBrace '{'> 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 op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<1>})] more_env: [] do_fork: T ) (C {<git>} {<update-index>} {<--add>} {<--cacheinfo>} {<100644>} {($ Id.VSub_DollarName EMPTY_BLOB)} {<1>} ) (C {<git>} {<update-index>} {<--skip-worktree>} {<1>}) ] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name: test_dirty body: (BraceGroup left: <Id.Lit_LBrace '{'> 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 op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>})] more_env: [] do_fork: T ) (command.Simple words: [{<git>} {<ls-files>} {<--stage>} {<1>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<result>})] more_env: [] do_fork: T ) (C {<test_cmp>} {<expected>} {<result>}) (command.Simple words: [{<echo>} {<dirty>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>})] more_env: [] do_fork: T ) ] ) (C {<test_cmp>} {<expected>} {<1>}) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (C {<test_expect_success>} {(SQ <setup>)} { (SQ <'\n'> <'\ttest_commit init &&\n'> <'\tmkdir sub &&\n'> <'\ttouch ./1 ./2 sub/1 sub/2 &&\n'> <'\tgit add 1 2 sub/1 sub/2 &&\n'> <'\tgit update-index --skip-worktree 1 sub/1 &&\n'> <'\tgit ls-files -t > result &&\n'> <'\ttest_cmp expect.skip result\n'> ) } ) (C {<test_expect_success>} {(SQ <update-index>)} {(SQ <'\n'> <'\tsetup_absent &&\n'> <'\tgit update-index 1 &&\n'> <'\ttest_absent\n'>)} ) (C {<test_expect_success>} {(SQ <update-index>)} {(SQ <'\n'> <'\tsetup_dirty &&\n'> <'\tgit update-index 1 &&\n'> <'\ttest_dirty\n'>)} ) (C {<test_expect_success>} {(SQ <'update-index --remove'>)} { (SQ <'\n'> <'\tsetup_absent &&\n'> <'\tgit update-index --remove 1 &&\n'> <'\ttest -z "$(git ls-files 1)" &&\n'> <'\ttest ! -f 1\n'> ) } ) (C {<test_expect_success>} {(SQ <'update-index --remove'>)} { (SQ <'\n'> <'\tsetup_dirty &&\n'> <'\tgit update-index --remove 1 &&\n'> <'\ttest -z "$(git ls-files 1)" &&\n'> <'\techo dirty > expected &&\n'> <'\ttest_cmp expected 1\n'> ) } ) (C {<test_expect_success>} {(SQ <'ls-files --deleted'>)} {(SQ <'\n'> <'\tsetup_absent &&\n'> <'\ttest -z "$(git ls-files -d)"\n'>)} ) (C {<test_expect_success>} {(SQ <'ls-files --deleted'>)} {(SQ <'\n'> <'\tsetup_dirty &&\n'> <'\ttest -z "$(git ls-files -d)"\n'>)} ) (C {<test_expect_success>} {(SQ <'ls-files --modified'>)} {(SQ <'\n'> <'\tsetup_absent &&\n'> <'\ttest -z "$(git ls-files -m)"\n'>)} ) (C {<test_expect_success>} {(SQ <'ls-files --modified'>)} {(SQ <'\n'> <'\tsetup_dirty &&\n'> <'\ttest -z "$(git ls-files -m)"\n'>)} ) (C {<test_expect_success>} {(SQ <'grep with skip-worktree file'>)} { (SQ <'\n'> <'\tgit update-index --no-skip-worktree 1 &&\n'> <'\techo test > 1 &&\n'> <'\tgit update-index 1 &&\n'> <'\tgit update-index --skip-worktree 1 &&\n'> <'\trm 1 &&\n'> <'\ttest "$(git grep --no-ext-grep test)" = "1:test"\n'> ) } ) (command.Simple words: [ {<echo>} { (DQ <':000000 100644 '> ($ Id.VSub_DollarName _z40) <' '> ($ Id.VSub_DollarName EMPTY_BLOB) <' A\t1'> ) } ] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>})] more_env: [] do_fork: T ) (C {<test_expect_success>} {(SQ <'diff-index does not examine skip-worktree absent entries'>)} { (SQ <'\n'> <'\tsetup_absent &&\n'> <'\tgit diff-index HEAD -- 1 > result &&\n'> <'\ttest_cmp expected result\n'> ) } ) (C {<test_expect_success>} {(SQ <'diff-index does not examine skip-worktree dirty entries'>)} { (SQ <'\n'> <'\tsetup_dirty &&\n'> <'\tgit diff-index HEAD -- 1 > result &&\n'> <'\ttest_cmp expected result\n'> ) } ) (C {<test_expect_success>} {(SQ <'diff-files does not examine skip-worktree absent entries'>)} {(SQ <'\n'> <'\tsetup_absent &&\n'> <'\ttest -z "$(git diff-files -- one)"\n'>)} ) (C {<test_expect_success>} {(SQ <'diff-files does not examine skip-worktree dirty entries'>)} {(SQ <'\n'> <'\tsetup_dirty &&\n'> <'\ttest -z "$(git diff-files -- one)"\n'>)} ) (C {<test_expect_success>} {(SQ <'git-rm succeeds on skip-worktree absent entries'>)} {(SQ <'\n'> <'\tsetup_absent &&\n'> <'\tgit rm 1\n'>)} ) (C {<test_expect_success>} {(SQ <'commit on skip-worktree absent entries'>)} { (SQ <'\n'> <'\tgit reset &&\n'> <'\tsetup_absent &&\n'> <'\ttest_must_fail git commit -m null 1\n'> ) } ) (C {<test_expect_success>} {(SQ <'commit on skip-worktree dirty entries'>)} { (SQ <'\n'> <'\tgit reset &&\n'> <'\tsetup_dirty &&\n'> <'\ttest_must_fail git commit -m null 1\n'> ) } ) (C {<test_done>}) ] )