(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:'Two way merge with read-tree -m $H $M\n' span_id:15) (Token id:Id.Lit_Chars val:'\n' span_id:16) (Token id: Id.Lit_Chars val: 'This test tries two-way merge (aka fast-forward with carry forward).\n' span_id: 17 ) (Token id:Id.Lit_Chars val:'\n' span_id:18) (Token id: Id.Lit_Chars val: 'There is the head (called H) and another commit (called M), which is\n' span_id: 19 ) (Token id: Id.Lit_Chars val: 'simply ahead of H. The index and the work tree contains a state that\n' span_id: 20 ) (Token id: Id.Lit_Chars val: 'is derived from H, but may also have local changes. This test checks\n' span_id: 21 ) (Token id: Id.Lit_Chars val: 'all the combinations described in the two-tree merge "carry forward"\n' span_id: 22 ) (Token id:Id.Lit_Chars val:'rules, found in <Documentation/git read-tree.txt>.\n' span_id:23) (Token id:Id.Lit_Chars val:'\n' span_id:24) (Token id:Id.Lit_Chars val:'In the test, these paths are used:\n' span_id:25) (Token id: Id.Lit_Chars val: ' bozbar - in H, stays in M, modified from bozbar to gnusto\n' span_id: 26 ) (Token id:Id.Lit_Chars val:' frotz - not in H added in M\n' span_id:27) (Token id: Id.Lit_Chars val: ' nitfol - in H, stays in M unmodified\n' span_id: 28 ) (Token id:Id.Lit_Chars val:' rezrov - in H, deleted in M\n' span_id:29) (Token id:Id.Lit_Chars val:'\tyomin - not in H or M\n' span_id:30) ) } spids: [13] ) ] ) (C {(.)} {(./test-lib.sh)}) (C {(.)} {(DQ ($ Id.VSub_DollarName '$TEST_DIRECTORY')) (/lib-read-tree.sh)}) (command.ShFunction name: read_tree_twoway body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(git)} {(read-tree)} {(-m)} {(DQ ($ Id.VSub_Number '$1'))} {(DQ ($ Id.VSub_Number '$2'))} ) (C {(git)} {(ls-files)} {(--stage)}) ] ) ] ) ) (command.ShFunction name: compare_change body: (command.BraceGroup children: [ (command.Simple words: [ {(sed)} {(-n)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'/^--- /d; /^+++ /d; /^@@ /d;' span_id:98))} {(-e)} { (SQ (Token id: Id.Lit_Chars val: 's/^\\([-+][0-7][0-7][0-7][0-7][0-7][0-7]\\) ' span_id: 106 ) ) (DQ ($ Id.VSub_DollarName '$_x40')) (SQ (Token id:Id.Lit_Chars val:' /\\1 X /p' span_id:112)) } {(DQ ($ Id.VSub_Number '$1'))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:90) fd: -1 arg_word: {(current)} ) ] ) (C {(test_cmp)} {(expected)} {(current)}) ] ) ) (command.ShFunction name: check_cache_at body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:clean_if_empty) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:140) command_list: (command.CommandList children: [(C {(git)} {(diff-files)} {(--)} {(DQ ($ Id.VSub_Number '$1'))})] ) ) } spids: [139] ) ] ) (command.Case to_match: {(DQ ($ Id.VSub_DollarName '$clean_if_empty'))} arms: [ (case_arm pat_list: [{(SQ )}] action: [(C {(echo)} {(DQ ($ Id.VSub_Number '$1') (': clean'))})] spids: [162 164 173 -1] ) (case_arm pat_list: [{(Id.Lit_QMark '?') (Id.Lit_Star '*')}] action: [(C {(echo)} {(DQ ($ Id.VSub_Number '$1') (': dirty'))})] spids: [176 178 187 -1] ) ] ) (command.Case to_match: {(DQ ($ Id.VSub_Number '$2') (',') ($ Id.VSub_DollarName '$clean_if_empty'))} arms: [ (case_arm pat_list: [{(clean) (Id.Lit_Comma ',')}] action: [(C {(Id.Lit_Other ':')})] spids: [204 206 210 -1] ) (case_arm pat_list: [{(clean) (Id.Lit_Comma ',') (Id.Lit_QMark '?') (Id.Lit_Star '*')}] action: [(C {(false)})] spids: [213 217 221 -1] ) (case_arm pat_list: [{(dirty) (Id.Lit_Comma ',')}] action: [(C {(false)})] spids: [224 226 230 -1] ) (case_arm pat_list: [{(dirty) (Id.Lit_Comma ',') (Id.Lit_QMark '?') (Id.Lit_Star '*')}] action: [(C {(Id.Lit_Other ':')})] spids: [233 237 241 -1] ) ] ) ] ) ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:251) fd: -1 arg_word: {(bozbar-old)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:254) fd: -1 here_begin: {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:255)) (OF) } here_end_span_id: 264 stdin_parts: [ ('This is a sample file used in two-way fast-forward merge\n') ('tests. Its second line ends with a magic word bozbar\n') ('which will be modified by the merged head to gnusto.\n') ('It has some extra lines so that external tools can\n') ('successfully merge independent changes made to later\n') ('lines (such as this one), avoiding line conflicts.\n') ] ) ] ) (command.Simple words: [ {(sed)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'s/bozbar/gnusto (earlier bozbar)/' span_id:271))} {(bozbar-old)} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:276) fd: -1 arg_word: {(bozbar-new)} ) ] ) (C {(test_expect_success)} {(setup)} { (SQ (Token id:Id.Lit_Chars val:'echo frotz >frotz &&\n' span_id:289) (Token id:Id.Lit_Chars val:' echo nitfol >nitfol &&\n' span_id:290) (Token id:Id.Lit_Chars val:' cat bozbar-old >bozbar &&\n' span_id:291) (Token id:Id.Lit_Chars val:' echo rezrov >rezrov &&\n' span_id:292) (Token id:Id.Lit_Chars val:' echo yomin >yomin &&\n' span_id:293) (Token id: Id.Lit_Chars val: ' git update-index --add nitfol bozbar rezrov &&\n' span_id: 294 ) (Token id:Id.Lit_Chars val:' treeH=$(git write-tree) &&\n' span_id:295) (Token id:Id.Lit_Chars val:' echo treeH $treeH &&\n' span_id:296) (Token id:Id.Lit_Chars val:' git ls-tree $treeH &&\n' span_id:297) (Token id:Id.Lit_Chars val:'\n' span_id:298) (Token id:Id.Lit_Chars val:' cat bozbar-new >bozbar &&\n' span_id:299) (Token id: Id.Lit_Chars val: ' git update-index --add frotz bozbar --force-remove rezrov &&\n' span_id: 300 ) (Token id:Id.Lit_Chars val:' git ls-files --stage >M.out &&\n' span_id:301) (Token id:Id.Lit_Chars val:' treeM=$(git write-tree) &&\n' span_id:302) (Token id:Id.Lit_Chars val:' echo treeM $treeM &&\n' span_id:303) (Token id:Id.Lit_Chars val:' git ls-tree $treeM &&\n' span_id:304) (Token id:Id.Lit_Chars val:' git diff-tree $treeH $treeM' span_id:305) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'1, 2, 3 - no carry forward' span_id:314))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:320) (Token id: Id.Lit_Chars val: ' read_tree_twoway $treeH $treeM &&\n' span_id: 321 ) (Token id:Id.Lit_Chars val:' git ls-files --stage >1-3.out &&\n' span_id:322) (Token id:Id.Lit_Chars val:' test_cmp M.out 1-3.out &&\n' span_id:323) (Token id:Id.Lit_Chars val:' check_cache_at bozbar dirty &&\n' span_id:324) (Token id:Id.Lit_Chars val:' check_cache_at frotz dirty &&\n' span_id:325) (Token id:Id.Lit_Chars val:' check_cache_at nitfol dirty' span_id:326) ) } ) (command.Simple words: [{(echo)} {(SQ (Token id:Id.Lit_Chars val:'+100644 X 0\tyomin' span_id:333))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:336) fd: -1 arg_word: {(expected)} ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'4 - carry forward local addition.' span_id:345))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:351) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:352) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:353) (Token id:Id.Lit_Chars val:' git update-index --add yomin &&\n' span_id:354) (Token id:Id.Lit_Chars val:' read_tree_twoway $treeH $treeM &&\n' span_id:355) (Token id:Id.Lit_Chars val:' git ls-files --stage >4.out &&\n' span_id:356) (Token id: Id.Lit_Chars val: ' test_must_fail git diff --no-index M.out 4.out >4diff.out &&\n' span_id: 357 ) (Token id:Id.Lit_Chars val:' compare_change 4diff.out expected &&\n' span_id:358) (Token id:Id.Lit_Chars val:' check_cache_at yomin clean' span_id:359) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'5 - carry forward local addition.' span_id:368))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:374) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:375) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:376) (Token id:Id.Lit_Chars val:' echo yomin >yomin &&\n' span_id:377) (Token id:Id.Lit_Chars val:' git update-index --add yomin &&\n' span_id:378) (Token id:Id.Lit_Chars val:' echo yomin yomin >yomin &&\n' span_id:379) (Token id:Id.Lit_Chars val:' read_tree_twoway $treeH $treeM &&\n' span_id:380) (Token id:Id.Lit_Chars val:' git ls-files --stage >5.out &&\n' span_id:381) (Token id: Id.Lit_Chars val: ' test_must_fail git diff --no-index M.out 5.out >5diff.out &&\n' span_id: 382 ) (Token id:Id.Lit_Chars val:' compare_change 5diff.out expected &&\n' span_id:383) (Token id:Id.Lit_Chars val:' check_cache_at yomin dirty' span_id:384) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'6 - local addition already has the same.' span_id:393))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:399) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:400) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:401) (Token id:Id.Lit_Chars val:' git update-index --add frotz &&\n' span_id:402) (Token id:Id.Lit_Chars val:' read_tree_twoway $treeH $treeM &&\n' span_id:403) (Token id:Id.Lit_Chars val:' git ls-files --stage >6.out &&\n' span_id:404) (Token id:Id.Lit_Chars val:' test_cmp M.out 6.out &&\n' span_id:405) (Token id:Id.Lit_Chars val:' check_cache_at frotz clean' span_id:406) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'7 - local addition already has the same.' span_id:415))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:421) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:422) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:423) (Token id:Id.Lit_Chars val:' echo frotz >frotz &&\n' span_id:424) (Token id:Id.Lit_Chars val:' git update-index --add frotz &&\n' span_id:425) (Token id:Id.Lit_Chars val:' echo frotz frotz >frotz &&\n' span_id:426) (Token id:Id.Lit_Chars val:' read_tree_twoway $treeH $treeM &&\n' span_id:427) (Token id:Id.Lit_Chars val:' git ls-files --stage >7.out &&\n' span_id:428) (Token id:Id.Lit_Chars val:' test_cmp M.out 7.out &&\n' span_id:429) (Token id:Id.Lit_Chars val:' check_cache_at frotz dirty' span_id:430) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'8 - conflicting addition.' span_id:439))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:445) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:446) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:447) (Token id:Id.Lit_Chars val:' echo frotz frotz >frotz &&\n' span_id:448) (Token id:Id.Lit_Chars val:' git update-index --add frotz &&\n' span_id:449) (Token id: Id.Lit_Chars val: ' if read_tree_twoway $treeH $treeM; then false; else :; fi' span_id: 450 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'9 - conflicting addition.' span_id:459))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:465) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:466) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:467) (Token id:Id.Lit_Chars val:' echo frotz frotz >frotz &&\n' span_id:468) (Token id:Id.Lit_Chars val:' git update-index --add frotz &&\n' span_id:469) (Token id:Id.Lit_Chars val:' echo frotz >frotz &&\n' span_id:470) (Token id: Id.Lit_Chars val: ' if read_tree_twoway $treeH $treeM; then false; else :; fi' span_id: 471 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'10 - path removed.' span_id:480))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:486) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:487) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:488) (Token id:Id.Lit_Chars val:' echo rezrov >rezrov &&\n' span_id:489) (Token id:Id.Lit_Chars val:' git update-index --add rezrov &&\n' span_id:490) (Token id: Id.Lit_Chars val: ' read_tree_twoway $treeH $treeM &&\n' span_id: 491 ) (Token id:Id.Lit_Chars val:' git ls-files --stage >10.out &&\n' span_id:492) (Token id:Id.Lit_Chars val:' test_cmp M.out 10.out' span_id:493) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'11 - dirty path removed.' span_id:502))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:508) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:509) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:510) (Token id:Id.Lit_Chars val:' echo rezrov >rezrov &&\n' span_id:511) (Token id:Id.Lit_Chars val:' git update-index --add rezrov &&\n' span_id:512) (Token id:Id.Lit_Chars val:' echo rezrov rezrov >rezrov &&\n' span_id:513) (Token id: Id.Lit_Chars val: ' if read_tree_twoway $treeH $treeM; then false; else :; fi' span_id: 514 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'12 - unmatching local changes being removed.' span_id:523))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:529) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:530) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:531) (Token id:Id.Lit_Chars val:' echo rezrov rezrov >rezrov &&\n' span_id:532) (Token id:Id.Lit_Chars val:' git update-index --add rezrov &&\n' span_id:533) (Token id: Id.Lit_Chars val: ' if read_tree_twoway $treeH $treeM; then false; else :; fi' span_id: 534 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'13 - unmatching local changes being removed.' span_id:543))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:549) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:550) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:551) (Token id:Id.Lit_Chars val:' echo rezrov rezrov >rezrov &&\n' span_id:552) (Token id:Id.Lit_Chars val:' git update-index --add rezrov &&\n' span_id:553) (Token id:Id.Lit_Chars val:' echo rezrov >rezrov &&\n' span_id:554) (Token id: Id.Lit_Chars val: ' if read_tree_twoway $treeH $treeM; then false; else :; fi' span_id: 555 ) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:561) fd: -1 arg_word: {(expected)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:564) fd: -1 here_begin: {(EOF)} here_end_span_id: 570 stdin_parts: [('-100644 X 0\tnitfol\n') ('+100644 X 0\tnitfol\n')] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'14 - unchanged in two heads.' span_id:577))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:583) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:584) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:585) (Token id:Id.Lit_Chars val:' echo nitfol nitfol >nitfol &&\n' span_id:586) (Token id:Id.Lit_Chars val:' git update-index --add nitfol &&\n' span_id:587) (Token id: Id.Lit_Chars val: ' read_tree_twoway $treeH $treeM &&\n' span_id: 588 ) (Token id:Id.Lit_Chars val:' git ls-files --stage >14.out &&\n' span_id:589) (Token id: Id.Lit_Chars val: ' test_must_fail git diff --no-index M.out 14.out >14diff.out &&\n' span_id: 590 ) (Token id:Id.Lit_Chars val:' compare_change 14diff.out expected &&\n' span_id:591) (Token id:Id.Lit_Chars val:' check_cache_at nitfol clean' span_id:592) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'15 - unchanged in two heads.' span_id:601))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:607) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:608) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:609) (Token id:Id.Lit_Chars val:' echo nitfol nitfol >nitfol &&\n' span_id:610) (Token id:Id.Lit_Chars val:' git update-index --add nitfol &&\n' span_id:611) (Token id: Id.Lit_Chars val: ' echo nitfol nitfol nitfol >nitfol &&\n' span_id: 612 ) (Token id:Id.Lit_Chars val:' read_tree_twoway $treeH $treeM &&\n' span_id:613) (Token id:Id.Lit_Chars val:' git ls-files --stage >15.out &&\n' span_id:614) (Token id: Id.Lit_Chars val: ' test_must_fail git diff --no-index M.out 15.out >15diff.out &&\n' span_id: 615 ) (Token id:Id.Lit_Chars val:' compare_change 15diff.out expected &&\n' span_id:616) (Token id:Id.Lit_Chars val:' check_cache_at nitfol dirty' span_id:617) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'16 - conflicting local change.' span_id:626))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:632) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:633) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:634) (Token id:Id.Lit_Chars val:' echo bozbar bozbar >bozbar &&\n' span_id:635) (Token id:Id.Lit_Chars val:' git update-index --add bozbar &&\n' span_id:636) (Token id: Id.Lit_Chars val: ' if read_tree_twoway $treeH $treeM; then false; else :; fi' span_id: 637 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'17 - conflicting local change.' span_id:646))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:652) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:653) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:654) (Token id:Id.Lit_Chars val:' echo bozbar bozbar >bozbar &&\n' span_id:655) (Token id:Id.Lit_Chars val:' git update-index --add bozbar &&\n' span_id:656) (Token id: Id.Lit_Chars val: ' echo bozbar bozbar bozbar >bozbar &&\n' span_id: 657 ) (Token id: Id.Lit_Chars val: ' if read_tree_twoway $treeH $treeM; then false; else :; fi' span_id: 658 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'18 - local change already having a good result.' span_id:667))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:673) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:674) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:675) (Token id:Id.Lit_Chars val:' cat bozbar-new >bozbar &&\n' span_id:676) (Token id:Id.Lit_Chars val:' git update-index --add bozbar &&\n' span_id:677) (Token id: Id.Lit_Chars val: ' read_tree_twoway $treeH $treeM &&\n' span_id: 678 ) (Token id:Id.Lit_Chars val:' git ls-files --stage >18.out &&\n' span_id:679) (Token id:Id.Lit_Chars val:' test_cmp M.out 18.out &&\n' span_id:680) (Token id:Id.Lit_Chars val:' check_cache_at bozbar clean' span_id:681) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '19 - local change already having a good result, further modified.' span_id: 690 ) ) } { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:696) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:697) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:698) (Token id:Id.Lit_Chars val:' cat bozbar-new >bozbar &&\n' span_id:699) (Token id:Id.Lit_Chars val:' git update-index --add bozbar &&\n' span_id:700) (Token id:Id.Lit_Chars val:' echo gnusto gnusto >bozbar &&\n' span_id:701) (Token id:Id.Lit_Chars val:' read_tree_twoway $treeH $treeM &&\n' span_id:702) (Token id:Id.Lit_Chars val:' git ls-files --stage >19.out &&\n' span_id:703) (Token id:Id.Lit_Chars val:' test_cmp M.out 19.out &&\n' span_id:704) (Token id:Id.Lit_Chars val:' check_cache_at bozbar dirty' span_id:705) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'20 - no local change, use new tree.' span_id:714))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:720) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:721) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:722) (Token id:Id.Lit_Chars val:' cat bozbar-old >bozbar &&\n' span_id:723) (Token id:Id.Lit_Chars val:' git update-index --add bozbar &&\n' span_id:724) (Token id: Id.Lit_Chars val: ' read_tree_twoway $treeH $treeM &&\n' span_id: 725 ) (Token id:Id.Lit_Chars val:' git ls-files --stage >20.out &&\n' span_id:726) (Token id:Id.Lit_Chars val:' test_cmp M.out 20.out &&\n' span_id:727) (Token id:Id.Lit_Chars val:' check_cache_at bozbar dirty' span_id:728) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'21 - no local change, dirty cache.' span_id:737))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:743) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:744) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:745) (Token id:Id.Lit_Chars val:' cat bozbar-old >bozbar &&\n' span_id:746) (Token id:Id.Lit_Chars val:' git update-index --add bozbar &&\n' span_id:747) (Token id:Id.Lit_Chars val:' echo gnusto gnusto >bozbar &&\n' span_id:748) (Token id: Id.Lit_Chars val: ' if read_tree_twoway $treeH $treeM; then false; else :; fi' span_id: 749 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'22 - local change cache updated.' span_id:761))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:767) (Token id:Id.Lit_Chars val:' read_tree_must_succeed $treeH &&\n' span_id:768) (Token id:Id.Lit_Chars val:' git checkout-index -u -f -q -a &&\n' span_id:769) (Token id: Id.Lit_Chars val: ' sed -e "s/such as/SUCH AS/" bozbar-old >bozbar &&\n' span_id: 770 ) (Token id:Id.Lit_Chars val:' git update-index --add bozbar &&\n' span_id:771) (Token id: Id.Lit_Chars val: ' if read_tree_twoway $treeH $treeM; then false; else :; fi' span_id: 772 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'DF vs DF/DF case setup.' span_id:784))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:790) (Token id:Id.Lit_Chars val:' echo DF >DF &&\n' span_id:791) (Token id:Id.Lit_Chars val:' git update-index --add DF &&\n' span_id:792) (Token id:Id.Lit_Chars val:' treeDF=$(git write-tree) &&\n' span_id:793) (Token id:Id.Lit_Chars val:' echo treeDF $treeDF &&\n' span_id:794) (Token id:Id.Lit_Chars val:' git ls-tree $treeDF &&\n' span_id:795) (Token id:Id.Lit_Chars val:'\n' span_id:796) (Token id:Id.Lit_Chars val:' rm -f DF &&\n' span_id:797) (Token id:Id.Lit_Chars val:' mkdir DF &&\n' span_id:798) (Token id:Id.Lit_Chars val:' echo DF/DF >DF/DF &&\n' span_id:799) (Token id:Id.Lit_Chars val:' git update-index --add --remove DF DF/DF &&\n' span_id:800) (Token id:Id.Lit_Chars val:' treeDFDF=$(git write-tree) &&\n' span_id:801) (Token id:Id.Lit_Chars val:' echo treeDFDF $treeDFDF &&\n' span_id:802) (Token id:Id.Lit_Chars val:' git ls-tree $treeDFDF &&\n' span_id:803) (Token id:Id.Lit_Chars val:' git ls-files --stage >DFDF.out' span_id:804) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'DF vs DF/DF case test.' span_id:813))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:819) (Token id:Id.Lit_Chars val:' rm -fr DF &&\n' span_id:820) (Token id:Id.Lit_Chars val:' echo DF >DF &&\n' span_id:821) (Token id:Id.Lit_Chars val:' git update-index --add DF &&\n' span_id:822) (Token id:Id.Lit_Chars val:' read_tree_twoway $treeDF $treeDFDF &&\n' span_id:823) (Token id: Id.Lit_Chars val: ' git ls-files --stage >DFDFcheck.out &&\n' span_id: 824 ) (Token id:Id.Lit_Chars val:' test_cmp DFDF.out DFDFcheck.out &&\n' span_id:825) (Token id:Id.Lit_Chars val:' check_cache_at DF/DF dirty &&\n' span_id:826) (Token id:Id.Lit_Chars val:' :' span_id:827) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'a/b (untracked) vs a case setup.' span_id:836))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:842) (Token id:Id.Lit_Chars val:' : >a &&\n' span_id:843) (Token id:Id.Lit_Chars val:' git update-index --add a &&\n' span_id:844) (Token id:Id.Lit_Chars val:' treeM=$(git write-tree) &&\n' span_id:845) (Token id:Id.Lit_Chars val:' echo treeM $treeM &&\n' span_id:846) (Token id:Id.Lit_Chars val:' git ls-tree $treeM &&\n' span_id:847) (Token id:Id.Lit_Chars val:' git ls-files --stage >treeM.out &&\n' span_id:848) (Token id:Id.Lit_Chars val:'\n' span_id:849) (Token id:Id.Lit_Chars val:' rm -f a &&\n' span_id:850) (Token id:Id.Lit_Chars val:' git update-index --remove a &&\n' span_id:851) (Token id:Id.Lit_Chars val:' mkdir a &&\n' span_id:852) (Token id:Id.Lit_Chars val:' : >a/b &&\n' span_id:853) (Token id:Id.Lit_Chars val:' treeH=$(git write-tree) &&\n' span_id:854) (Token id:Id.Lit_Chars val:' echo treeH $treeH &&\n' span_id:855) (Token id:Id.Lit_Chars val:' git ls-tree $treeH' span_id:856) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'a/b (untracked) vs a, plus c/d case test.' span_id:865))} { (SQ (Token id: Id.Lit_Chars val: 'read_tree_u_must_fail -u -m "$treeH" "$treeM" &&\n' span_id: 871 ) (Token id:Id.Lit_Chars val:' git ls-files --stage &&\n' span_id:872) (Token id:Id.Lit_Chars val:' test -f a/b' span_id:873) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'a/b vs a, plus c/d case setup.' span_id:882))} { (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:888) (Token id:Id.Lit_Chars val:' rm -fr a &&\n' span_id:889) (Token id:Id.Lit_Chars val:' : >a &&\n' span_id:890) (Token id:Id.Lit_Chars val:' mkdir c &&\n' span_id:891) (Token id:Id.Lit_Chars val:' : >c/d &&\n' span_id:892) (Token id:Id.Lit_Chars val:' git update-index --add a c/d &&\n' span_id:893) (Token id:Id.Lit_Chars val:' treeM=$(git write-tree) &&\n' span_id:894) (Token id:Id.Lit_Chars val:' echo treeM $treeM &&\n' span_id:895) (Token id:Id.Lit_Chars val:' git ls-tree $treeM &&\n' span_id:896) (Token id: Id.Lit_Chars val: ' git ls-files --stage >treeM.out &&\n' span_id: 897 ) (Token id:Id.Lit_Chars val:'\n' span_id:898) (Token id:Id.Lit_Chars val:' rm -f a &&\n' span_id:899) (Token id:Id.Lit_Chars val:' mkdir a &&\n' span_id:900) (Token id:Id.Lit_Chars val:' : >a/b &&\n' span_id:901) (Token id:Id.Lit_Chars val:' git update-index --add --remove a a/b &&\n' span_id:902) (Token id:Id.Lit_Chars val:' treeH=$(git write-tree) &&\n' span_id:903) (Token id:Id.Lit_Chars val:' echo treeH $treeH &&\n' span_id:904) (Token id:Id.Lit_Chars val:' git ls-tree $treeH' span_id:905) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'a/b vs a, plus c/d case test.' span_id:914))} { (SQ (Token id: Id.Lit_Chars val: 'read_tree_u_must_succeed -u -m "$treeH" "$treeM" &&\n' span_id: 920 ) (Token id:Id.Lit_Chars val:' git ls-files --stage | tee >treeMcheck.out &&\n' span_id:921) (Token id:Id.Lit_Chars val:' test_cmp treeM.out treeMcheck.out' span_id:922) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'-m references the correct modified tree' span_id:929))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:933) (Token id:Id.Lit_Chars val:'\techo >file-a &&\n' span_id:934) (Token id:Id.Lit_Chars val:'\techo >file-b &&\n' span_id:935) (Token id:Id.Lit_Chars val:'\tgit add file-a file-b &&\n' span_id:936) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "test for correct modified tree" &&\n' span_id:937) (Token id:Id.Lit_Chars val:'\tgit branch initial-mod &&\n' span_id:938) (Token id:Id.Lit_Chars val:'\techo b >file-b &&\n' span_id:939) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "B" &&\n' span_id:940) (Token id:Id.Lit_Chars val:'\techo a >file-a &&\n' span_id:941) (Token id:Id.Lit_Chars val:'\tgit add file-a &&\n' span_id:942) (Token id:Id.Lit_Chars val:'\tgit ls-tree $(git write-tree) file-a >expect &&\n' span_id:943) (Token id: Id.Lit_Chars val: '\tread_tree_must_succeed -m HEAD initial-mod &&\n' span_id: 944 ) (Token id:Id.Lit_Chars val:'\tgit ls-tree $(git write-tree) file-a >actual &&\n' span_id:945) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:946) ) } ) (C {(test_done)}) ] )