test suite now passes after OsPath conversion

The test suite was failing because of a bug in the Database/* modules.
I had replaced doesPathExist with doesDirectoryExist, but it was
checking the database file.

I have audited commit f1ba21d698 for
other changes to doesPathExist, and checked that doesDirectoryExist and
doesFileExist were used correctly.

The only change I found is in youtubeDl', where it used to return
directories that might have been created by youtube-dl. But it was
supposed to return media files, so changing it to use doesFileExist is
actually an improvement. Although only of theoretical benefit.

Note that it would actually be possible to keep using doesPathExist,
there is a version of that for OsPath as well. But the rest of these
changes seem safe.

Sponsored-by: Nicholas Golder-Manning
This commit is contained in:
Joey Hess 2025-02-11 12:37:09 -04:00
parent c85d5a0dc8
commit 5dbaaae299
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 6 additions and 6 deletions

View file

@ -129,7 +129,7 @@ openDb forwrite _ = do
catchPermissionDenied permerr $ withExclusiveLock lck $ do
dbdir <- calcRepo' gitAnnexKeysDbDir
let db = dbdir </> literalOsPath "db"
dbexists <- liftIO $ doesDirectoryExist db
dbexists <- liftIO $ doesFileExist db
case dbexists of
True -> open db False
False -> do