Re: [PATCH] git-apply: fix --3way with binary patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jerry Zhang <jerry@xxxxxxxxxx> 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 &&



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux