(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 apply should not get confused with type changes.\n' span_id: 15 ) (Token id:Id.Lit_Chars val:'\n' span_id:16) ) } spids: [13] ) ] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'setup repository and commits' span_id:28))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:32) (Token id:Id.Lit_Chars val:'\techo "hello world" > foo &&\n' span_id:33) (Token id:Id.Lit_Chars val:'\techo "hi planet" > bar &&\n' span_id:34) (Token id:Id.Lit_Chars val:'\tgit update-index --add foo bar &&\n' span_id:35) (Token id:Id.Lit_Chars val:'\tgit commit -m initial &&\n' span_id:36) (Token id:Id.Lit_Chars val:'\tgit branch initial &&\n' span_id:37) (Token id:Id.Lit_Chars val:'\trm -f foo &&\n' span_id:38) (Token id:Id.Lit_Chars val:'\ttest_ln_s_add bar foo &&\n' span_id:39) (Token id:Id.Lit_Chars val:'\tgit commit -m "foo symlinked to bar" &&\n' span_id:40) (Token id:Id.Lit_Chars val:'\tgit branch foo-symlinked-to-bar &&\n' span_id:41) (Token id:Id.Lit_Chars val:'\tgit rm -f foo &&\n' span_id:42) (Token id:Id.Lit_Chars val:'\techo "how far is the sun?" > foo &&\n' span_id:43) (Token id:Id.Lit_Chars val:'\tgit update-index --add foo &&\n' span_id:44) (Token id:Id.Lit_Chars val:'\tgit commit -m "foo back to file" &&\n' span_id:45) (Token id:Id.Lit_Chars val:'\tgit branch foo-back-to-file &&\n' span_id:46) (Token id:Id.Lit_Chars val:'\tprintf "\\0" > foo &&\n' span_id:47) (Token id:Id.Lit_Chars val:'\tgit update-index foo &&\n' span_id:48) (Token id: Id.Lit_Chars val: '\tgit commit -m "foo becomes binary" &&\n' span_id: 49 ) (Token id:Id.Lit_Chars val:'\tgit branch foo-becomes-binary &&\n' span_id:50) (Token id:Id.Lit_Chars val:'\trm -f foo &&\n' span_id:51) (Token id:Id.Lit_Chars val:'\tgit update-index --remove foo &&\n' span_id:52) (Token id:Id.Lit_Chars val:'\tmkdir foo &&\n' span_id:53) (Token id:Id.Lit_Chars val:'\techo "if only I knew" > foo/baz &&\n' span_id:54) (Token id:Id.Lit_Chars val:'\tgit update-index --add foo/baz &&\n' span_id:55) (Token id:Id.Lit_Chars val:'\tgit commit -m "foo becomes a directory" &&\n' span_id:56) (Token id: Id.Lit_Chars val: '\tgit branch "foo-becomes-a-directory" &&\n' span_id: 57 ) (Token id:Id.Lit_Chars val:'\techo "hello world" > foo/baz &&\n' span_id:58) (Token id:Id.Lit_Chars val:'\tgit update-index foo/baz &&\n' span_id:59) (Token id:Id.Lit_Chars val:'\tgit commit -m "foo/baz is the original foo" &&\n' span_id:60) (Token id:Id.Lit_Chars val:'\tgit branch foo-baz-renamed-from-foo\n' span_id:61) (Token id:Id.Lit_Chars val:'\t' span_id:62) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'file renamed from foo to foo/baz' span_id:69))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:73) (Token id:Id.Lit_Chars val:'\tgit checkout -f initial &&\n' span_id:74) (Token id: Id.Lit_Chars val: '\tgit diff-tree -M -p HEAD foo-baz-renamed-from-foo > patch &&\n' span_id: 75 ) (Token id:Id.Lit_Chars val:'\tgit apply --index < patch\n' span_id:76) (Token id:Id.Lit_Chars val:'\t' span_id:77) ) } ) (C {(test_debug)} {(SQ (Token id:Id.Lit_Chars val:'cat patch' span_id:83))}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'file renamed from foo/baz to foo' span_id:91))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:95) (Token id: Id.Lit_Chars val: '\tgit checkout -f foo-baz-renamed-from-foo &&\n' span_id: 96 ) (Token id:Id.Lit_Chars val:'\tgit diff-tree -M -p HEAD initial > patch &&\n' span_id:97) (Token id:Id.Lit_Chars val:'\tgit apply --index < patch\n' span_id:98) (Token id:Id.Lit_Chars val:'\t' span_id:99) ) } ) (C {(test_debug)} {(SQ (Token id:Id.Lit_Chars val:'cat patch' span_id:105))}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'directory becomes file' span_id:113))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:117) (Token id: Id.Lit_Chars val: '\tgit checkout -f foo-becomes-a-directory &&\n' span_id: 118 ) (Token id:Id.Lit_Chars val:'\tgit diff-tree -p HEAD initial > patch &&\n' span_id:119) (Token id:Id.Lit_Chars val:'\tgit apply --index < patch\n' span_id:120) (Token id:Id.Lit_Chars val:'\t' span_id:121) ) } ) (C {(test_debug)} {(SQ (Token id:Id.Lit_Chars val:'cat patch' span_id:127))}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'file becomes directory' span_id:135))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:139) (Token id:Id.Lit_Chars val:'\tgit checkout -f initial &&\n' span_id:140) (Token id: Id.Lit_Chars val: '\tgit diff-tree -p HEAD foo-becomes-a-directory > patch &&\n' span_id: 141 ) (Token id:Id.Lit_Chars val:'\tgit apply --index < patch\n' span_id:142) (Token id:Id.Lit_Chars val:'\t' span_id:143) ) } ) (C {(test_debug)} {(SQ (Token id:Id.Lit_Chars val:'cat patch' span_id:149))}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'file becomes symlink' span_id:157))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:161) (Token id:Id.Lit_Chars val:'\tgit checkout -f initial &&\n' span_id:162) (Token id:Id.Lit_Chars val:'\tgit diff-tree -p HEAD foo-symlinked-to-bar > patch &&\n' span_id:163) (Token id:Id.Lit_Chars val:'\tgit apply --index < patch\n' span_id:164) (Token id:Id.Lit_Chars val:'\t' span_id:165) ) } ) (C {(test_debug)} {(SQ (Token id:Id.Lit_Chars val:'cat patch' span_id:171))}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'symlink becomes file' span_id:179))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:183) (Token id: Id.Lit_Chars val: '\tgit checkout -f foo-symlinked-to-bar &&\n' span_id: 184 ) (Token id:Id.Lit_Chars val:'\tgit diff-tree -p HEAD foo-back-to-file > patch &&\n' span_id:185) (Token id:Id.Lit_Chars val:'\tgit apply --index < patch\n' span_id:186) (Token id:Id.Lit_Chars val:'\t' span_id:187) ) } ) (C {(test_debug)} {(SQ (Token id:Id.Lit_Chars val:'cat patch' span_id:193))}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'binary file becomes symlink' span_id:200))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:204) (Token id: Id.Lit_Chars val: '\tgit checkout -f foo-becomes-binary &&\n' span_id: 205 ) (Token id: Id.Lit_Chars val: '\tgit diff-tree -p --binary HEAD foo-symlinked-to-bar > patch &&\n' span_id: 206 ) (Token id:Id.Lit_Chars val:'\tgit apply --index < patch\n' span_id:207) (Token id:Id.Lit_Chars val:'\t' span_id:208) ) } ) (C {(test_debug)} {(SQ (Token id:Id.Lit_Chars val:'cat patch' span_id:214))}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'symlink becomes binary file' span_id:221))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:225) (Token id: Id.Lit_Chars val: '\tgit checkout -f foo-symlinked-to-bar &&\n' span_id: 226 ) (Token id: Id.Lit_Chars val: '\tgit diff-tree -p --binary HEAD foo-becomes-binary > patch &&\n' span_id: 227 ) (Token id:Id.Lit_Chars val:'\tgit apply --index < patch\n' span_id:228) (Token id:Id.Lit_Chars val:'\t' span_id:229) ) } ) (C {(test_debug)} {(SQ (Token id:Id.Lit_Chars val:'cat patch' span_id:235))}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'symlink becomes directory' span_id:243))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:247) (Token id: Id.Lit_Chars val: '\tgit checkout -f foo-symlinked-to-bar &&\n' span_id: 248 ) (Token id: Id.Lit_Chars val: '\tgit diff-tree -p HEAD foo-becomes-a-directory > patch &&\n' span_id: 249 ) (Token id:Id.Lit_Chars val:'\tgit apply --index < patch\n' span_id:250) (Token id:Id.Lit_Chars val:'\t' span_id:251) ) } ) (C {(test_debug)} {(SQ (Token id:Id.Lit_Chars val:'cat patch' span_id:257))}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'directory becomes symlink' span_id:265))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:269) (Token id: Id.Lit_Chars val: '\tgit checkout -f foo-becomes-a-directory &&\n' span_id: 270 ) (Token id:Id.Lit_Chars val:'\tgit diff-tree -p HEAD foo-symlinked-to-bar > patch &&\n' span_id:271) (Token id:Id.Lit_Chars val:'\tgit apply --index < patch\n' span_id:272) (Token id:Id.Lit_Chars val:'\t' span_id:273) ) } ) (C {(test_debug)} {(SQ (Token id:Id.Lit_Chars val:'cat patch' span_id:279))}) (C {(test_done)}) ] )