Re: [PATCH v2 1/2] rev-parse tests: add tests executed from a subdirectory
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 10, 2017, 20:25 UTC
- Message-ID
- <xmqqpoipkd3l.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <cc23463af8096c5f8429f939ce881cf0eb5c2dcd.1486740772.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 11 quoted lines
> diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh > index 292a0720fcc..1d6e27a09d8 100755 > --- a/t/t1700-split-index.sh > +++ b/t/t1700-split-index.sh > @@ -200,4 +200,21 @@ EOF > test_cmp expect actual > ' > > +test_expect_failure 'rev-parse --shared-index-path' ' > + rm -rf .git && > + test_create_repo . &&
Another thing that I notice only after merging this and other topics to 'pu' was that this piece needs to always come at the end of the script because of this removal. It would make the test more robust to create a test repository for this test and work inside it.
Show 15 quoted lines
> + git update-index --split-index && > + ls -t .git/sharedindex* | tail -n 1 >expect && > + git rev-parse --shared-index-path >actual && > + test_cmp expect actual && > + mkdir work && > + test_when_finished "rm -rf work" && > + ( > + cd work && > + ls -t ../.git/sharedindex* | tail -n 1 >expect && > + git rev-parse --shared-index-path >actual && > + test_cmp expect actual > + ) > +' > + > test_done