3 # Copyright (c) 2005 Junio C Hamano
6 test_description='git-apply handling binary patches
14 A quick brown fox jumps over the lazy dog.
15 A tiny little penguin runs around in circles.
16 There is a flag with Linux written on it.
17 A slow black-and-white panda just sits there,
18 munching on his bamboo.
23 git-update-index --add --remove file1 file2 file4
24 git-commit -m 'Initial Version' 2>/dev/null
26 git-checkout -b binary
27 tr 'x' '\0' <file1 >file3
30 tr '\0' 'v' <file3 >file1
32 git-update-index --add --remove file1 file2 file3 file4
33 git-commit -m 'Second Version'
35 git-diff-tree -p master binary >B.diff
36 git-diff-tree -p -C master binary >C.diff
38 test_expect_success 'stat binary diff -- should not fail.' \
40 git-apply --stat --summary B.diff'
42 test_expect_success 'stat binary diff (copy) -- should not fail.' \
44 git-apply --stat --summary C.diff'
46 test_expect_failure 'check binary diff -- should fail.' \
48 git-apply --check B.diff'
50 test_expect_failure 'check binary diff (copy) -- should fail.' \
52 git-apply --check C.diff'
54 test_expect_failure 'check incomplete binary diff with replacement -- should fail.' \
56 git-apply --check --allow-binary-replacement B.diff'
58 test_expect_failure 'check incomplete binary diff with replacement (copy) -- should fail.' \
60 git-apply --check --allow-binary-replacement C.diff'
62 # Now we start applying them.
64 test_expect_failure 'apply binary diff -- should fail.' \
70 test_expect_failure 'apply binary diff -- should fail.' \
72 git-apply --index B.diff'
76 test_expect_failure 'apply binary diff (copy) -- should fail.' \
82 test_expect_failure 'apply binary diff (copy) -- should fail.' \
84 git-apply --index C.diff'