From d99270c450d8f9ef3ecfbcbeeb99b581f36c9175 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 24 May 2012 18:01:11 -0400 Subject: new: Centralize file type stat-ing logic This moves our logic to get a file's type into one function. This has several benefits: we can support OSes and file systems that do not provide dirent.d_type or always return DT_UNKNOWN, complex symlink-handling logic has been replaced by a simple stat fall-through in one place, and the error message for un-stat-able file is more accurate (previously, the error always mentioned directories, even though a broken symlink is not a directory). --- test/new | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/new b/test/new index a7bc146..cab7c01 100755 --- a/test/new +++ b/test/new @@ -140,7 +140,7 @@ test_begin_subtest "Broken symlink aborts" ln -s does-not-exist "${MAIL_DIR}/broken" output=$(NOTMUCH_NEW 2>&1) test_expect_equal "$output" \ -"Error reading directory ${MAIL_DIR}/broken: No such file or directory +"Error reading file ${MAIL_DIR}/broken: No such file or directory Note: A fatal error was encountered: Something went wrong trying to read or write a file No new mail." rm "${MAIL_DIR}/broken" -- cgit v1.2.3