aboutsummaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-01-01 13:22:38 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-01-01 13:22:38 -0400
commit802f4615d785a520744c912446dab06569526a91 (patch)
treea489061ac78c410b5e91d67de065dc6484ca1a4e /Annex
parenteb18baf6b84c59faee1b309bbe0721d0f11f4a70 (diff)
convert isPointerFile from Annex to IO
Diffstat (limited to 'Annex')
-rw-r--r--Annex/AutoMerge.hs2
-rw-r--r--Annex/Content.hs2
-rw-r--r--Annex/Link.hs4
3 files changed, 4 insertions, 4 deletions
diff --git a/Annex/AutoMerge.hs b/Annex/AutoMerge.hs
index a332596f6..462e87e09 100644
--- a/Annex/AutoMerge.hs
+++ b/Annex/AutoMerge.hs
@@ -248,7 +248,7 @@ cleanConflictCruft resolvedks resolvedfs unstagedmap = do
| S.member f fs || S.member (conflictCruftBase f) fs = anyM id
[ pure (S.member i is)
, inks <$> isAnnexLink f
- , inks <$> isPointerFile f
+ , inks <$> liftIO (isPointerFile f)
]
| otherwise = return False
diff --git a/Annex/Content.hs b/Annex/Content.hs
index be460f068..2a8b295d3 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -505,7 +505,7 @@ moveAnnex key src = withObjectLoc key storeobject storedirect
alreadyhave = liftIO $ removeFile src
populatePointerFile :: Key -> FilePath -> FilePath -> Annex ()
-populatePointerFile k obj f = go =<< isPointerFile f
+populatePointerFile k obj f = go =<< liftIO (isPointerFile f)
where
go (Just k') | k == k' = do
liftIO $ nukeFile f
diff --git a/Annex/Link.hs b/Annex/Link.hs
index 61c61b561..7f1a1b14d 100644
--- a/Annex/Link.hs
+++ b/Annex/Link.hs
@@ -153,6 +153,6 @@ formatPointer k =
toInternalGitPath (pathSeparator:objectDir </> key2file k) ++ "\n"
{- Checks if a file is a pointer to a key. -}
-isPointerFile :: FilePath -> Annex (Maybe Key)
-isPointerFile f = liftIO $ catchDefaultIO Nothing $
+isPointerFile :: FilePath -> IO (Maybe Key)
+isPointerFile f = catchDefaultIO Nothing $
parseLinkOrPointer <$> L.readFile f