Re: [PATCH v2] tests: modernize the test script t0010-racy-git.sh
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Feb 29, 2024, 23:22 UTC
- Message-ID
- <CAPig+cQ5m86=pLTpFrik0xS6XPyK4tZQx_wkc1xh2r9WDFkhuQ@mail.gmail.com>
- In-Reply-To
- <xmqqle72c17i.fsf@gitster.g>
On Thu, Feb 29, 2024 at 6:14 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> So, we may want to do it more like this, perhaps? > > test_expect_success "Racy GIT trial #$trial part A" ' > rm -f .git/index && > echo frotz >infocom && > git update-index --add infocom && > echo xyzzy >infocom && > > files=$(git diff-files -p) && > test "" != "$files" > '
If taking it to this extent, then the modernized version of the last couple lines would be:
git diff-files -p >out &&
test_file_not_empty out