#!/bin/sh global test_description := ''git apply for contextually independent diffs'' source ./test-lib.sh echo '1 2 3 4 5 6 7 8' >file test_expect_success 'setup' \ 'git add file && git commit -q -m 1 && git checkout -b test && mv file file.tmp && echo 0 >file && cat file.tmp >>file && rm file.tmp && git commit -a -q -m 2 && echo 9 >>file && git commit -a -q -m 3 && git checkout master' test_expect_success \ 'check if contextually independent diffs for the same file apply' \ '( git diff test~2 test~1; git diff test~1 test~0 )| git apply' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"git apply for contextually independent diffs">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (SimpleCommand words: [{(echo)} {(SQ <"1\n"> <"2\n"> <"3\n"> <"4\n"> <"5\n"> <"6\n"> <"7\n"> <8>)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(file)} spids:[27])] ) (C {(test_expect_success)} {(SQ )} { (SQ <"git add file &&\n"> <"\tgit commit -q -m 1 &&\n"> <"\tgit checkout -b test &&\n"> <"\tmv file file.tmp &&\n"> <"\techo 0 >file &&\n"> <"\tcat file.tmp >>file &&\n"> <"\trm file.tmp &&\n"> <"\tgit commit -a -q -m 2 &&\n"> <"\techo 9 >>file &&\n"> <"\tgit commit -a -q -m 3 &&\n"> <"\tgit checkout master"> ) } ) (C {(test_expect_success)} {(SQ <"check if contextually independent diffs for the same file apply">)} {(SQ <"( git diff test~2 test~1; git diff test~1 test~0 )| git apply">)} ) (C {(test_done)}) ] )