Re: [PATCH 2/2] Add test for the new status message

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

 



Kaartic Sivaraam <kaarticsivaraam91196@xxxxxxxxx> writes:

> +test_expect_success 'No commits yet should be noted in status output' '
> +       git init initial &&
> +       cd initial &&
> +       git status >output &&
> +       test_i18ngrep "No commits yet" output &&
> +       test_commit initial &&
> +       git status >output &&
> +       test_i18ngrep ! "No commits yet" output &&
> +       test_i18ngrep "nothing.*to commit" output
> +'
> +

Do not "cd" in a test, without being in a subshell.  When other
people in the future want to add new tests to the end of this
script, the new test will end up running in the new subdirectory,
which is not something they should have to worry about.

	git checkout --orphan empty-branch &&
	git status >output &&
	test_i18ngrep "No commits yet" output &&
	...

perhaps?


>  test_done



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