(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description) op: Equal rhs: {(SQ <'skip-worktree bit test'>)} ) ] ) (C {(.)} {(./test-lib.sh)}) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect.full)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 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.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect.skip)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 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.FuncDef name: setup_absent body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [(C {(test)} {(-f)} {(1)}) (C {(rm)} {(1)})] ) (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (C {(git)} {(update-index)} {(--remove)} {(1)}) (C {(git)} {(update-index)} {(--add)} {(--cacheinfo)} {(100644)} {($ VSub_DollarName '$EMPTY_BLOB')} {(1)} ) (C {(git)} {(update-index)} {(--skip-worktree)} {(1)}) ] ) ] ) ) (command.FuncDef name: test_absent body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (command.SimpleCommand words: [{(echo)} {(DQ ('100644 ') ($ VSub_DollarName '$EMPTY_BLOB') (' 0\t1'))}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)})] ) (command.SimpleCommand words: [{(git)} {(ls-files)} {(--stage)} {(1)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(result)})] ) (C {(test_cmp)} {(expected)} {(result)}) (C {(test)} {(KW_Bang '!')} {(-f)} {(1)}) ] ) ] ) ) (command.FuncDef name: setup_dirty body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (C {(git)} {(update-index)} {(--force-remove)} {(1)}) (command.SimpleCommand words: [{(echo)} {(dirty)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(1)})] ) (C {(git)} {(update-index)} {(--add)} {(--cacheinfo)} {(100644)} {($ VSub_DollarName '$EMPTY_BLOB')} {(1)} ) (C {(git)} {(update-index)} {(--skip-worktree)} {(1)}) ] ) ] ) ) (command.FuncDef name: test_dirty body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (command.SimpleCommand words: [{(echo)} {(DQ ('100644 ') ($ VSub_DollarName '$EMPTY_BLOB') (' 0\t1'))}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)})] ) (command.SimpleCommand words: [{(git)} {(ls-files)} {(--stage)} {(1)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(result)})] ) (C {(test_cmp)} {(expected)} {(result)}) (command.SimpleCommand words: [{(echo)} {(dirty)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)})] ) ] ) (C {(test_cmp)} {(expected)} {(1)}) ] ) ) (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.SimpleCommand words: [ {(echo)} { (DQ (':000000 100644 ') ($ VSub_DollarName '$_z40') (' ') ($ VSub_DollarName '$EMPTY_BLOB') (' A\t1') ) } ] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)})] ) (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)}) ] )