(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 checkout-index test.\n' span_id:15) (Token id:Id.Lit_Chars val:'\n' span_id:16) (Token id: Id.Lit_Chars val: 'This test registers the following filesystem structure in the cache:\n' span_id: 17 ) (Token id:Id.Lit_Chars val:'\n' span_id:18) (Token id: Id.Lit_Chars val: ' path0/file0\t- a file in a directory\n' span_id: 19 ) (Token id:Id.Lit_Chars val:' path1/file1 - a file in a directory\n' span_id:20) (Token id:Id.Lit_Chars val:'\n' span_id:21) (Token id:Id.Lit_Chars val:'and attempts to check it out when the work tree has:\n' span_id:22) (Token id:Id.Lit_Chars val:'\n' span_id:23) (Token id:Id.Lit_Chars val:' path0/file0 - a file in a directory\n' span_id:24) (Token id: Id.Lit_Chars val: ' path1 - a symlink pointing at "path0"\n' span_id: 25 ) (Token id:Id.Lit_Chars val:'\n' span_id:26) (Token id: Id.Lit_Chars val: 'Checkout cache should fail to extract path1/file1 because the leading\n' span_id: 27 ) (Token id: Id.Lit_Chars val: 'path path1 is occupied by a non-directory. With "-f" it should remove\n' span_id: 28 ) (Token id: Id.Lit_Chars val: 'the symlink path1 and create directory path1 and file path1/file1.\n' span_id: 29 ) ) } spids: [13] ) ] ) (C {(.)} {(./test-lib.sh)}) (command.ShFunction name: show_files body: (command.BraceGroup children: [ (command.Pipeline children: [ (C {(find)} {(path) (Id.Lit_QMark '?')} {(-ls)}) (C {(sed)} {(-e)} { (SQ (Token id: Id.Lit_Chars val: 's/^[0-9]* * [0-9]* * \\([-bcdl]\\)[^ ]* *[0-9]* *[^ ]* *[^ ]* *[0-9]* [A-Z][a-z][a-z] [0-9][0-9] [^ ]* /fs: \\1 /' span_id: 63 ) ) } ) ] negated: F ) (command.Pipeline children: [ (C {(git)} {(ls-files)} {(--stage)}) (C {(sed)} {(-e)} { (SQ (Token id: Id.Lit_Chars val: 's/^\\([0-9]*\\) [0-9a-f]* [0-3] /ca: \\1 /' span_id: 85 ) ) } ) ] negated: F ) (command.Pipeline children: [ (C {(git)} {(ls-tree)} {(-r)} {(DQ ($ Id.VSub_Number '$1'))}) (C {(sed)} {(-e)} { (SQ (Token id: Id.Lit_Chars val: 's/^\\([0-9]*\\)\t[^ ]*\t[0-9a-f]*\t/tr: \\1 /' span_id: 111 ) ) } ) ] negated: F ) ] ) ) (C {(mkdir)} {(path0)}) (command.Simple words: [{(date)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:123) fd: -1 arg_word: {(path0/file0)} ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git update-index --add path0/file0' span_id:131))} {(SQ (Token id:Id.Lit_Chars val:'git update-index --add path0/file0' span_id:137))} ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'writing tree out with git write-tree' span_id:145))} {(SQ (Token id:Id.Lit_Chars val:'tree1=$(git write-tree)' span_id:151))} ) (C {(test_debug)} {(SQ (Token id:Id.Lit_Chars val:'show_files $tree1' span_id:157))}) (C {(mkdir)} {(path1)}) (command.Simple words: [{(date)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:167) fd: -1 arg_word: {(path1/file1)} ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git update-index --add path1/file1' span_id:175))} {(SQ (Token id:Id.Lit_Chars val:'git update-index --add path1/file1' span_id:181))} ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'writing tree out with git write-tree' span_id:189))} {(SQ (Token id:Id.Lit_Chars val:'tree2=$(git write-tree)' span_id:195))} ) (C {(test_debug)} {(SQ (Token id:Id.Lit_Chars val:'show_files $tree2' span_id:201))}) (C {(rm)} {(-fr)} {(path1)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'read previously written tree and checkout.' span_id:216))} {(SQ (Token id:Id.Lit_Chars val:'git read-tree -m $tree1 && git checkout-index -f -a' span_id:222))} ) (C {(test_debug)} {(SQ (Token id:Id.Lit_Chars val:'show_files $tree1' span_id:228))}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'add a symlink' span_id:237))} {(SQ (Token id:Id.Lit_Chars val:'test_ln_s_add path0 path1' span_id:243))} ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'writing tree out with git write-tree' span_id:251))} {(SQ (Token id:Id.Lit_Chars val:'tree3=$(git write-tree)' span_id:257))} ) (C {(test_debug)} {(SQ (Token id:Id.Lit_Chars val:'show_files $tree3' span_id:263))}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'read previously written tree and checkout.' span_id:279))} {(SQ (Token id:Id.Lit_Chars val:'git read-tree $tree2 && git checkout-index -f -a' span_id:285))} ) (C {(test_debug)} {(SQ (Token id:Id.Lit_Chars val:'show_files $tree2' span_id:291))}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'checking out conflicting path with -f' span_id:300))} { (SQ (Token id:Id.Lit_Chars val:'test ! -h path0 && test -d path0 &&\n' span_id:306) (Token id: Id.Lit_Chars val: ' test ! -h path1 && test -d path1 &&\n' span_id: 307 ) (Token id:Id.Lit_Chars val:' test ! -h path0/file0 && test -f path0/file0 &&\n' span_id:308) (Token id: Id.Lit_Chars val: ' test ! -h path1/file1 && test -f path1/file1' span_id: 309 ) ) } ) (C {(test_done)}) ] )