Re: [PATCH v6] git-p4: add config git-p4.pathEncoding

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

 



larsxschneider@xxxxxxxxx writes:

> +test_expect_success 'Clone repo containing iso8859-1 encoded paths without git-p4.pathEncoding' '
> +	git p4 clone --destination="$git" //depot &&
> +	test_when_finished cleanup_git &&
> +	(
> +		cd "$git" &&
> +		UTF8="$(printf "$UTF8_ESCAPED")" &&
> +		echo $UTF8 >expect &&
> +		git -c core.quotepath=false ls-files >actual &&
> +		test_must_fail test_cmp expect actual

I am not sure what this test wants to do.  It is not inconceivable
that future versions of "git p4 clone" becomes more intelligent to
detect the need for git-p4.pathEncoding and set it, so the only
effect to insist the comparison fails is to block future advance in
that direction.

Besides, "test_must_fail test_cmp" looks like a strange thing to
say.  "! test_cmp expect actual" perhaps.

Even better, expect that "expect" and "actual" becomes the same, but
mark the test itself to expect failure, to say "it ought to work
this way in the ideal world, but we know the system currently does
not pass this test".

I'm tempted to suggest squashing the following in.  Thoughts?


 t/t9822-git-p4-path-encoding.sh | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/t/t9822-git-p4-path-encoding.sh b/t/t9822-git-p4-path-encoding.sh
index e507ad7..2d652d89 100755
--- a/t/t9822-git-p4-path-encoding.sh
+++ b/t/t9822-git-p4-path-encoding.sh
@@ -21,15 +21,15 @@ test_expect_success 'Create a repo containing iso8859-1 encoded paths' '
 	)
 '
 
-test_expect_success 'Clone repo containing iso8859-1 encoded paths without git-p4.pathEncoding' '
+test_expect_failure 'Clone auto-detects depot with iso8859-1 paths' '
 	git p4 clone --destination="$git" //depot &&
 	test_when_finished cleanup_git &&
 	(
 		cd "$git" &&
 		UTF8="$(printf "$UTF8_ESCAPED")" &&
-		echo $UTF8 >expect &&
+		echo "$UTF8" >expect &&
 		git -c core.quotepath=false ls-files >actual &&
-		test_must_fail test_cmp expect actual
+		test_cmp expect actual
 	)
 '
 
@@ -39,16 +39,15 @@ test_expect_success 'Clone repo containing iso8859-1 encoded paths with git-p4.p
 	(
 		cd "$git" &&
 		git init . &&
-		test_config git-p4.pathEncoding iso8859-1 &&
+		git config git-p4.pathEncoding iso8859-1 &&
 		git p4 clone --use-client-spec --destination="$git" //depot &&
 		UTF8="$(printf "$UTF8_ESCAPED")" &&
-		echo $UTF8 >expect &&
+		echo "$UTF8" >expect &&
 		git -c core.quotepath=false ls-files >actual &&
 		test_cmp expect actual &&
-		cat >expect <<-\EOF &&
-		content123
-		EOF
-		cat $UTF8 >actual &&
+
+		echo content123 >expect &&
+		cat "$UTF8" >actual &&
 		test_cmp expect actual
 	)
 '
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]