Re: [PATCH v3] test_dir_is_empty: properly detect files with newline in name

2018-08-12 Thread Eric Sunshine
On Sun, Aug 12, 2018 at 2:33 AM William Chargin wrote: > > This is an abuse of test_must_fail() which is intended strictly for > > testing 'git' invocations which might fail for reasons other than the > > expected one (for instance, git might crash). > > Interesting. I didn't infer this from the

Re: [PATCH v3] test_dir_is_empty: properly detect files with newline in name

2018-08-12 Thread William Chargin
Thanks for the review. > We usually avoid "touch" unless the timestamp of the file is > significant. Makes sense. Will change as you suggest. > This is an abuse of test_must_fail() which is intended strictly for > testing 'git' invocations which might fail for reasons other than the > expected

Re: [PATCH v3] test_dir_is_empty: properly detect files with newline in name

2018-08-12 Thread Eric Sunshine
On Sun, Aug 12, 2018 at 12:07 AM William Chargin wrote: > While the `test_dir_is_empty` function appears correct in most normal > use cases, it can fail when filenames contain newlines. This patch > changes the implementation to check that the output of `ls -a` has at > most two lines (for `.`

[PATCH v3] test_dir_is_empty: properly detect files with newline in name

2018-08-11 Thread William Chargin
While the `test_dir_is_empty` function appears correct in most normal use cases, it can fail when filenames contain newlines. This patch changes the implementation to check that the output of `ls -a` has at most two lines (for `.` and `..`), which should be better behaved. The newly added unit