Re: [PATCH 1/1] t/test-lib: make `test_dir_is_empty` more robust
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Aug 6, 2018, 17:52 UTC
- Message-ID
- <CAPig+cQK7JSosa0hNhgw7xoSui2f0m6yfRLWytsg_Zow3bN5bg@mail.gmail.com>
- In-Reply-To
- <20180806130216.GA29966@sigill.intra.peff.net>
On Mon, Aug 6, 2018 at 9:02 AM Jeff King <peff@peff.net> wrote:
Show 7 quoted lines
> On Sun, Aug 05, 2018 at 04:52:31PM -0400, Jeff King wrote: > > Perhaps even simpler: > > > > test "$1" = "$(find "$1")" > > Actually, I guess it needs to add "-print", since IIRC that is not the > default on some old versions of "find".
You recall correctly.
I tend to avoid 'find' in scripts when I don't need its recursive behavior due to *extremely* poor performance on Windows (at least that was the case years ago), especially when there are a lot of files in the directory being listed. However, for this usage, we expect the directory to be empty, so perhaps performance isn't an issue.