(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: 'test worktree writing operations when skip-worktree is used' span_id: 15 ) ) } spids: [13] ) ] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:setup span_id:27))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:31) (Token id:Id.Lit_Chars val:'\ttest_commit init &&\n' span_id:32) (Token id:Id.Lit_Chars val:'\techo modified >> init.t &&\n' span_id:33) (Token id:Id.Lit_Chars val:'\ttouch added &&\n' span_id:34) (Token id:Id.Lit_Chars val:'\tgit add init.t added &&\n' span_id:35) (Token id: Id.Lit_Chars val: '\tgit commit -m "modified and added" &&\n' span_id: 36 ) (Token id:Id.Lit_Chars val:'\tgit tag top\n' span_id:37) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'read-tree updates worktree, absent case' span_id:44))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:48) (Token id:Id.Lit_Chars val:'\tgit checkout -f top &&\n' span_id:49) (Token id:Id.Lit_Chars val:'\tgit update-index --skip-worktree init.t &&\n' span_id:50) (Token id:Id.Lit_Chars val:'\trm init.t &&\n' span_id:51) (Token id:Id.Lit_Chars val:'\tgit read-tree -m -u HEAD^ &&\n' span_id:52) (Token id:Id.Lit_Chars val:'\techo init > expected &&\n' span_id:53) (Token id:Id.Lit_Chars val:'\ttest_cmp expected init.t\n' span_id:54) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'read-tree updates worktree, dirty case' span_id:61))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:65) (Token id:Id.Lit_Chars val:'\tgit checkout -f top &&\n' span_id:66) (Token id:Id.Lit_Chars val:'\tgit update-index --skip-worktree init.t &&\n' span_id:67) (Token id:Id.Lit_Chars val:'\techo dirty >> init.t &&\n' span_id:68) (Token id:Id.Lit_Chars val:'\ttest_must_fail git read-tree -m -u HEAD^ &&\n' span_id:69) (Token id:Id.Lit_Chars val:'\tgrep -q dirty init.t &&\n' span_id:70) (Token id:Id.Lit_Chars val:'\ttest "$(git ls-files -t init.t)" = "S init.t" &&\n' span_id:71) (Token id: Id.Lit_Chars val: '\tgit update-index --no-skip-worktree init.t\n' span_id: 72 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'read-tree removes worktree, absent case' span_id:79))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:83) (Token id:Id.Lit_Chars val:'\tgit checkout -f top &&\n' span_id:84) (Token id:Id.Lit_Chars val:'\tgit update-index --skip-worktree added &&\n' span_id:85) (Token id:Id.Lit_Chars val:'\trm added &&\n' span_id:86) (Token id:Id.Lit_Chars val:'\tgit read-tree -m -u HEAD^ &&\n' span_id:87) (Token id:Id.Lit_Chars val:'\ttest ! -f added\n' span_id:88) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'read-tree removes worktree, dirty case' span_id:95))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:99) (Token id:Id.Lit_Chars val:'\tgit checkout -f top &&\n' span_id:100) (Token id:Id.Lit_Chars val:'\tgit update-index --skip-worktree added &&\n' span_id:101) (Token id:Id.Lit_Chars val:'\techo dirty >> added &&\n' span_id:102) (Token id:Id.Lit_Chars val:'\ttest_must_fail git read-tree -m -u HEAD^ &&\n' span_id:103) (Token id:Id.Lit_Chars val:'\tgrep -q dirty added &&\n' span_id:104) (Token id:Id.Lit_Chars val:'\ttest "$(git ls-files -t added)" = "S added" &&\n' span_id:105) (Token id: Id.Lit_Chars val: '\tgit update-index --no-skip-worktree added\n' span_id: 106 ) ) } ) (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:184) 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:199) 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:248) 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:298) 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:313) 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:333) fd: -1 arg_word: {(expected)} ) ] ) ] ) (C {(test_cmp)} {(expected)} {(1)}) ] ) ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:349) fd: -1 arg_word: {(expected)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:352) fd: -1 here_begin: {(EOF)} here_end_span_id: 361 stdin_parts: [('S 1\n') ('H 2\n') ('H init.t\n') ('S sub/1\n') ('H sub/2\n')] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'index setup' span_id:366))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:370) (Token id:Id.Lit_Chars val:'\tgit checkout -f init &&\n' span_id:371) (Token id:Id.Lit_Chars val:'\tmkdir sub &&\n' span_id:372) (Token id:Id.Lit_Chars val:'\ttouch ./1 ./2 sub/1 sub/2 &&\n' span_id:373) (Token id:Id.Lit_Chars val:'\tgit add 1 2 sub/1 sub/2 &&\n' span_id:374) (Token id: Id.Lit_Chars val: '\tgit update-index --skip-worktree 1 sub/1 &&\n' span_id: 375 ) (Token id:Id.Lit_Chars val:'\tgit ls-files -t > result &&\n' span_id:376) (Token id:Id.Lit_Chars val:'\ttest_cmp expected result\n' span_id:377) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git-add ignores worktree content' span_id:384))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:388) (Token id:Id.Lit_Chars val:'\tsetup_absent &&\n' span_id:389) (Token id:Id.Lit_Chars val:'\tgit add 1 &&\n' span_id:390) (Token id:Id.Lit_Chars val:'\ttest_absent\n' span_id:391) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git-add ignores worktree content' span_id:398))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:402) (Token id:Id.Lit_Chars val:'\tsetup_dirty &&\n' span_id:403) (Token id:Id.Lit_Chars val:'\tgit add 1 &&\n' span_id:404) (Token id:Id.Lit_Chars val:'\ttest_dirty\n' span_id:405) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git-rm fails if worktree is dirty' 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_must_fail git rm 1 &&\n' span_id:418) (Token id:Id.Lit_Chars val:'\ttest_dirty\n' span_id:419) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:425) fd: -1 arg_word: {(expected)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:428) fd: -1 here_begin: {(EOF)} here_end_span_id: 434 stdin_parts: [('Would remove expected\n') ('Would remove result\n')] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git-clean, absent case' span_id:438))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:442) (Token id:Id.Lit_Chars val:'\tsetup_absent &&\n' span_id:443) (Token id:Id.Lit_Chars val:'\tgit clean -n > result &&\n' span_id:444) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expected result\n' span_id:445) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git-clean, dirty case' span_id:452))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:456) (Token id:Id.Lit_Chars val:'\tsetup_dirty &&\n' span_id:457) (Token id:Id.Lit_Chars val:'\tgit clean -n > result &&\n' span_id:458) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expected result\n' span_id:459) ) } ) (C {(test_done)}) ] )