From: Eric Sunshine Date: Mon, 06 Aug 2018 17:52:41 GMT Subject: Re: [PATCH 1/1] t/test-lib: make `test_dir_is_empty` more robust Message-ID: In-Reply-To: <20180806130216.GA29966@sigill.intra.peff.net> On Mon, Aug 6, 2018 at 9:02 AM Jeff King wrote: > 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.