git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jerry Zhang <jerry@skydio.com>
Cc: git@vger.kernel.org, lilinchao@oschina.cn
Subject: Re: [PATCH] git-apply: fix --3way with binary patch
Date: Tue, 27 Jul 2021 21:29:04 -0700	[thread overview]
Message-ID: <xmqqim0vawof.fsf@gitster.g> (raw)
In-Reply-To: <20210728024434.20230-1-jerry@skydio.com> (Jerry Zhang's message of "Tue, 27 Jul 2021 19:44:34 -0700")

Jerry Zhang <jerry@skydio.com> writes:

> diff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh
> index 65147efdea..d32748f899 100755
> --- a/t/t4108-apply-threeway.sh
> +++ b/t/t4108-apply-threeway.sh
> @@ -230,4 +230,49 @@ test_expect_success 'apply with --3way --cached and conflicts' '
>  	test_cmp expect.diff actual.diff
>  '
>  
> +test_expect_success 'apply binary file patch' '
> +	git reset --hard main &&
> +	cp $TEST_DIRECTORY/test-binary-1.png bin.png &&

Is it safe to use $TEST_DIRECTORY without quoting?  I doubt it, as
it is $(pwd) of whereever the testing user extracted our source
tarball.  

In other words, you'd need this.

diff --git w/t/t4108-apply-threeway.sh c/t/t4108-apply-threeway.sh
index d32748f899..cc3aa3314a 100755
--- w/t/t4108-apply-threeway.sh
+++ c/t/t4108-apply-threeway.sh
@@ -232,11 +232,11 @@ test_expect_success 'apply with --3way --cached and conflicts' '
 
 test_expect_success 'apply binary file patch' '
 	git reset --hard main &&
-	cp $TEST_DIRECTORY/test-binary-1.png bin.png &&
+	cp "$TEST_DIRECTORY/test-binary-1.png" bin.png &&
 	git add bin.png &&
 	git commit -m "add binary file" &&
 
-	cp $TEST_DIRECTORY/test-binary-2.png bin.png &&
+	cp "$TEST_DIRECTORY/test-binary-2.png" bin.png &&
 
 	git diff --binary >bin.diff &&
 	git reset --hard &&
@@ -247,11 +247,11 @@ test_expect_success 'apply binary file patch' '
 
 test_expect_success 'apply binary file patch with 3way' '
 	git reset --hard main &&
-	cp $TEST_DIRECTORY/test-binary-1.png bin.png &&
+	cp "$TEST_DIRECTORY/test-binary-1.png" bin.png &&
 	git add bin.png &&
 	git commit -m "add binary file" &&
 
-	cp $TEST_DIRECTORY/test-binary-2.png bin.png &&
+	cp "$TEST_DIRECTORY/test-binary-2.png" bin.png &&
 
 	git diff --binary >bin.diff &&
 	git reset --hard &&
@@ -262,11 +262,11 @@ test_expect_success 'apply binary file patch with 3way' '
 
 test_expect_success 'apply full-index patch with 3way' '
 	git reset --hard main &&
-	cp $TEST_DIRECTORY/test-binary-1.png bin.png &&
+	cp "$TEST_DIRECTORY/test-binary-1.png" bin.png &&
 	git add bin.png &&
 	git commit -m "add binary file" &&
 
-	cp $TEST_DIRECTORY/test-binary-2.png bin.png &&
+	cp "$TEST_DIRECTORY/test-binary-2.png" bin.png &&
 
 	git diff --full-index >bin.diff &&
 	git reset --hard &&

  reply	other threads:[~2021-07-28  4:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28  2:44 [PATCH] git-apply: fix --3way with binary patch Jerry Zhang
2021-07-28  4:29 ` Junio C Hamano [this message]
2021-07-28  4:30 ` Junio C Hamano
2021-07-28 17:55   ` [PATCH] ll-merge: teach ll_binary_merge() a trivial three-way merge Junio C Hamano
2021-07-28 23:49     ` Elijah Newren
2021-07-29  1:06       ` Junio C Hamano
2021-09-05 19:06         ` [PATCH v2] apply: resolve trivial merge without hitting ll-merge with "--3way" Junio C Hamano
2021-09-06 18:57           ` Elijah Newren
2021-09-06 21:59           ` Ævar Arnfjörð Bjarmason
2021-09-07  2:32             ` Junio C Hamano
2021-09-07 20:15             ` Junio C Hamano
2021-07-28 19:38   ` [PATCH] git-apply: fix --3way with binary patch Jerry Zhang
2021-07-28 20:04     ` Jerry Zhang
2021-07-28 20:08     ` Junio C Hamano
2021-07-28 20:37       ` Jerry Zhang
2021-07-28 21:01         ` Junio C Hamano
     [not found] <ee1d1a82ef4d11ebbb4cd4ae5278bc123046@skydio.com>
2021-07-28  4:45 ` lilinchao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqim0vawof.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jerry@skydio.com \
    --cc=lilinchao@oschina.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).