Re: [PATCH 2/2] Add test for the new status message
- From
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
- Date
- Jun 19, 2017, 17:59 UTC
- Message-ID
- <1497895189.18850.9.camel@gmail.com>
- In-Reply-To
- <xmqqh8zcvbq8.fsf@gitster.mtv.corp.google.com>
On Sun, 2017-06-18 at 21:32 -0700, Junio C Hamano wrote:
Show 29 quoted lines
> Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> 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
Fixed it. I wasn't aware of the guide lines for writing tests when I used the patch from the thread blindly. I'll be careful to avoid that in future.
Is there a way to test for the "Initial commit" message in the commit template?
-- Regards, Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>