summaryrefslogtreecommitdiff
path: root/Utility/Directory.hs
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2014-10-12 14:32:56 -0400
committerJoey Hess <joey@kitenet.net>2014-10-12 14:32:56 -0400
commitefef527d5b2e42e261fa7af6947aad6553426ebe (patch)
tree082a5dad993557e9dffd76a69d4087371da8ed42 /Utility/Directory.hs
parentab1cf3570207bd08ae0abbba183a8c570c0361f5 (diff)
downloadgit-repair-efef527d5b2e42e261fa7af6947aad6553426ebe.tar.gz
Merge from git-annex.
Includes changing to new exceptions library, and some whitespace fixes.
Diffstat (limited to 'Utility/Directory.hs')
-rw-r--r--Utility/Directory.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/Utility/Directory.hs b/Utility/Directory.hs
index ade5ef8..e4e4b80 100644
--- a/Utility/Directory.hs
+++ b/Utility/Directory.hs
@@ -11,7 +11,6 @@ module Utility.Directory where
import System.IO.Error
import System.Directory
-import Control.Exception (throw, bracket)
import Control.Monad
import Control.Monad.IfElse
import System.FilePath
@@ -57,7 +56,7 @@ dirContentsRecursive = dirContentsRecursiveSkipping (const False) True
dirContentsRecursiveSkipping :: (FilePath -> Bool) -> Bool -> FilePath -> IO [FilePath]
dirContentsRecursiveSkipping skipdir followsubdirsymlinks topdir = go [topdir]
where
- go [] = return []
+ go [] = return []
go (dir:dirs)
| skipdir (takeFileName dir) = go dirs
| otherwise = unsafeInterleaveIO $ do
@@ -88,7 +87,7 @@ dirContentsRecursiveSkipping skipdir followsubdirsymlinks topdir = go [topdir]
dirTreeRecursiveSkipping :: (FilePath -> Bool) -> FilePath -> IO [FilePath]
dirTreeRecursiveSkipping skipdir topdir = go [] [topdir]
where
- go c [] = return c
+ go c [] = return c
go c (dir:dirs)
| skipdir (takeFileName dir) = go c dirs
| otherwise = unsafeInterleaveIO $ do
@@ -114,7 +113,7 @@ moveFile src dest = tryIO (rename src dest) >>= onrename
whenM (isdir dest) rethrow
viaTmp mv dest undefined
where
- rethrow = throw e
+ rethrow = throwM e
mv tmp _ = do
ok <- boolSystem "mv" [Param "-f", Param src, Param tmp]
unless ok $ do