From 011f4274bbb14e44035586f2ede695d584b8cfd2 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 14 Nov 2005 17:37:05 -0800 Subject: apply: allow-binary-replacement. A new option, --allow-binary-replacement, is introduced. When you feed a diff that records full SHA1 name of pre- and post-image blob on its index line to git-apply with this option, the post-image blob replaces the path if what you have in the working tree matches the pre-image _and_ post-image blob is already available in the object directory. Later we _might_ want to enhance the diff output to also include the full binary data of the post-image, to make this more useful, but this is good enough for local rebasing application. Signed-off-by: Junio C Hamano --- t/t4103-apply-binary.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 't/t4103-apply-binary.sh') diff --git a/t/t4103-apply-binary.sh b/t/t4103-apply-binary.sh index 948d5b5a7a..9057f6d04f 100644 --- a/t/t4103-apply-binary.sh +++ b/t/t4103-apply-binary.sh @@ -51,6 +51,14 @@ test_expect_failure 'check binary diff (copy) -- should fail.' \ 'git-checkout master git-apply --check C.diff' +test_expect_failure 'check incomplete binary diff with replacement -- should fail.' \ + 'git-checkout master + git-apply --check --allow-binary-replacement B.diff' + +test_expect_failure 'check incomplete binary diff with replacement (copy) -- should fail.' \ + 'git-checkout master + git-apply --check --allow-binary-replacement C.diff' + # Now we start applying them. test_expect_failure 'apply binary diff -- should fail.' \ -- cgit v1.2.1