(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 diff with a bogus tree containing the null sha1' span_id: 6 ) ) } spids: [4] ) ] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'create bogus tree' span_id:17))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:21) (Token id:Id.Lit_Chars val:'\tbogus_tree=$(\n' span_id:22) (Token id:Id.Lit_Chars val:'\t\tprintf "100644 fooQQQQQQQQQQQQQQQQQQQQQ" |\n' span_id:23) (Token id:Id.Lit_Chars val:'\t\tq_to_nul |\n' span_id:24) (Token id:Id.Lit_Chars val:'\t\tgit hash-object -w --stdin -t tree\n' span_id:25) (Token id:Id.Lit_Chars val:'\t)\n' span_id:26) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'create tree with matching file' span_id:33))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:37) (Token id:Id.Lit_Chars val:'\techo bar >foo &&\n' span_id:38) (Token id:Id.Lit_Chars val:'\tgit add foo &&\n' span_id:39) (Token id:Id.Lit_Chars val:'\tgood_tree=$(git write-tree) &&\n' span_id:40) (Token id:Id.Lit_Chars val:'\tblob=$(git rev-parse :foo)\n' span_id:41) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'raw diff shows null sha1 (addition)' span_id:48))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:52) (Token id: Id.Lit_Chars val: '\techo ":000000 100644 $_z40 $_z40 A\tfoo" >expect &&\n' span_id: 53 ) (Token id:Id.Lit_Chars val:'\tgit diff-tree $EMPTY_TREE $bogus_tree >actual &&\n' span_id:54) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:55) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'raw diff shows null sha1 (removal)' span_id:62))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:66) (Token id: Id.Lit_Chars val: '\techo ":100644 000000 $_z40 $_z40 D\tfoo" >expect &&\n' span_id: 67 ) (Token id:Id.Lit_Chars val:'\tgit diff-tree $bogus_tree $EMPTY_TREE >actual &&\n' span_id:68) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:69) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'raw diff shows null sha1 (modification)' span_id:76))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:80) (Token id: Id.Lit_Chars val: '\techo ":100644 100644 $blob $_z40 M\tfoo" >expect &&\n' span_id: 81 ) (Token id:Id.Lit_Chars val:'\tgit diff-tree $good_tree $bogus_tree >actual &&\n' span_id:82) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:83) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'raw diff shows null sha1 (other direction)' span_id:90))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:94) (Token id: Id.Lit_Chars val: '\techo ":100644 100644 $_z40 $blob M\tfoo" >expect &&\n' span_id: 95 ) (Token id:Id.Lit_Chars val:'\tgit diff-tree $bogus_tree $good_tree >actual &&\n' span_id:96) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:97) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'raw diff shows null sha1 (reverse)' span_id:104))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:108) (Token id: Id.Lit_Chars val: '\techo ":100644 100644 $_z40 $blob M\tfoo" >expect &&\n' span_id: 109 ) (Token id:Id.Lit_Chars val:'\tgit diff-tree -R $good_tree $bogus_tree >actual &&\n' span_id:110) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:111) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'raw diff shows null sha1 (index)' span_id:118))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:122) (Token id: Id.Lit_Chars val: '\techo ":100644 100644 $_z40 $blob M\tfoo" >expect &&\n' span_id: 123 ) (Token id:Id.Lit_Chars val:'\tgit diff-index $bogus_tree >actual &&\n' span_id:124) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:125) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'patch fails due to bogus sha1 (addition)' span_id:132))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:136) (Token id: Id.Lit_Chars val: '\ttest_must_fail git diff-tree -p $EMPTY_TREE $bogus_tree\n' span_id: 137 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'patch fails due to bogus sha1 (removal)' span_id:144))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:148) (Token id: Id.Lit_Chars val: '\ttest_must_fail git diff-tree -p $bogus_tree $EMPTY_TREE\n' span_id: 149 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'patch fails due to bogus sha1 (modification)' span_id:156))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:160) (Token id: Id.Lit_Chars val: '\ttest_must_fail git diff-tree -p $good_tree $bogus_tree\n' span_id: 161 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'patch fails due to bogus sha1 (other direction)' span_id:168))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:172) (Token id: Id.Lit_Chars val: '\ttest_must_fail git diff-tree -p $bogus_tree $good_tree\n' span_id: 173 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'patch fails due to bogus sha1 (reverse)' span_id:180))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:184) (Token id: Id.Lit_Chars val: '\ttest_must_fail git diff-tree -R -p $good_tree $bogus_tree\n' span_id: 185 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'patch fails due to bogus sha1 (index)' span_id:192))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:196) (Token id: Id.Lit_Chars val: '\ttest_must_fail git diff-index -p $bogus_tree\n' span_id: 197 ) ) } ) (C {(test_done)}) ] )