Re: [PATCH v2 2/2] t1500-rev-parse: rewrite each test to run in isolation

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

 



Am 17.04.2016 um 07:59 schrieb Eric Sunshine:
On Sat, Apr 16, 2016 at 12:13:50PM -0400, Michael Rappazzo wrote:
+test_expect_success 'GIT_DIR=../.git, core.bare = false: prefix' '
+	mkdir work &&
+	test_when_finished "rm -rf work" &&
+	test_config -C "$(pwd)"/.git core.bare false &&
+	GIT_DIR=../.git test_stdout "" git -C work rev-parse --show-prefix >actual

Drop the unnecessary '>actual' redirection.

Not only that: setting an environment variable in front of a shell function invocation keeps the variable's value in some (most?) shells. This occurs frequently in the new code. I don't know whether we have a shorter pattern than

	(
		GIT_DIR=../.git &&
		export GIT_DIR &&
		test_stdout "" git -C work rev-parse --show-prefix
	)

-- Hannes

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