diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-01-01 20:50:07 +0000 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-01-01 20:50:07 +0000 |
commit | 5a086f664e9efbb25acb0652dc0e10adede61c2e (patch) | |
tree | 405ba59aec2689cc0616a2afcc211e4aedf11c06 /Utility/Directory.hs | |
parent | a332433aac213fdece32f9a9e5b5749853770abf (diff) | |
parent | a359c2841a68bb7fe6182fddc8e84abb7a463040 (diff) | |
download | git-repair-5a086f664e9efbb25acb0652dc0e10adede61c2e.tar.gz |
Merge remote-tracking branch 'dgit/dgit/sid'
Diffstat (limited to 'Utility/Directory.hs')
-rw-r--r-- | Utility/Directory.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Utility/Directory.hs b/Utility/Directory.hs index fae33b5..693e771 100644 --- a/Utility/Directory.hs +++ b/Utility/Directory.hs @@ -8,10 +8,12 @@ {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-tabs #-} -module Utility.Directory where +module Utility.Directory ( + module Utility.Directory, + module Utility.SystemDirectory +) where import System.IO.Error -import System.Directory import Control.Monad import System.FilePath import Control.Applicative @@ -28,6 +30,7 @@ import Utility.SafeCommand import Control.Monad.IfElse #endif +import Utility.SystemDirectory import Utility.PosixFiles import Utility.Tmp import Utility.Exception @@ -134,11 +137,13 @@ moveFile src dest = tryIO (rename src dest) >>= onrename _ <- tryIO $ removeFile tmp throwM e' +#ifndef mingw32_HOST_OS isdir f = do r <- tryIO $ getFileStatus f case r of (Left _) -> return False (Right s) -> return $ isDirectory s +#endif {- Removes a file, which may or may not exist, and does not have to - be a regular file. |