git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git apply --3way behaves abnormally when the patch contains binary changes.
@ 2021-07-27 14:07 lilinchao
  2021-07-27 22:44 ` Jerry Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: lilinchao @ 2021-07-27 14:07 UTC (permalink / raw)
  To: git; +Cc: jerry, Junio C Hamano

I see the latest change about `git apply --3way` is 923cd87, but it doesn't seem to have been fully tested
(in t4108-apply-threeway.sh).
On latest Git version 2.32.0, consider test case below:
"
test_expect_success 'apply binary file patch with --3way' '
        # 1. on new branch, commit binary file 
        git checkout -b left &&
        cat "$TEST_DIRECTORY"/test-binary-1.png >bin.png &&
        git add bin.png &&
        git commit -m "add binary file" &&

        # 2. based on left_bin branch, make any change, and commit
        git checkout -b right &&
        cat bin.png bin.png > bin.png &&
        git add bin.png &&
        git commit -m "update binary file" &&

        # 3. make patch
        git diff --binary left..right >bin.diff &&
        # apply --3way, and it will fail
        test_must_fail git apply --index --3way bin.diff
'
"

But  "git apply --index --3way bin.diff" will not faill on Git version 2.31.0.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-28  4:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-27 14:07 git apply --3way behaves abnormally when the patch contains binary changes lilinchao
2021-07-27 22:44 ` Jerry Zhang
2021-07-28  1:08   ` Junio C Hamano
2021-07-28  1:37     ` Jerry Zhang
     [not found]   ` <4eb90a4eef4011ebab68d4ae5272fd1139378@pobox.com>
2021-07-28  4:45     ` lilinchao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).