Re: [PATCH 1/9] t7006: GIT_DIR/config should be honored in subdirs of toplevel

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

 



Jonathan Nieder <jrnieder@xxxxxxxxx> writes:

> +unset GIT_PAGER
> +rm -f core.pager_used
> +rm -fr sub

Why do you have these outside the test itself?

> +test_expect_success TTY 'core.pager in subdir' '
> +	PAGER=wc &&
> +	stampname=$(pwd)/core.pager_used &&
> +	export PAGER stampname &&
> +	git config core.pager "wc > \"\$stampname\"" &&
> +	mkdir sub &&
> +	(
> +		cd sub &&
> +		test_terminal git log
> +	) &&
> +	test -e "$stampname"
> +'

They are reasonable clean-up steps to start the real test (starting from
setting and exporting the pager) in a known good state, and as long as you
write them not to fail I don't see any reason to have them outside the
test.  You _might_ want to "unset GIT_PAGER" immediately after the test
that does "export PAGER", so that it won't contaminate the environment the
test script itself runs, but even for that purpose, it would probably be
better to run the parts that depend on the exported value in a subshell.
--
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]