summaryrefslogtreecommitdiff
path: root/Annex/Perms.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-01-09 13:11:56 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-01-09 13:11:56 -0400
commit425bc1107aebdb701cdcee44da731dd918cd470d (patch)
tree25bcacb37277b70aa7bd0caaf0fe7c3edc665653 /Annex/Perms.hs
parent20c7644a4d85434cf49840ea92fca0c723710c72 (diff)
revert parentDir change
Reverts 2bba5bc22d049272d3328bfa6c452d3e2e50e86c Unfortunately, this caused breakage on Windows, and possibly elsewhere, because parentDir and takeDirectory do not behave the same when there is a trailing directory separator.
Diffstat (limited to 'Annex/Perms.hs')
-rw-r--r--Annex/Perms.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Annex/Perms.hs b/Annex/Perms.hs
index d314e382c..3430554c7 100644
--- a/Annex/Perms.hs
+++ b/Annex/Perms.hs
@@ -71,12 +71,12 @@ annexFileMode = withShared $ return . go
createAnnexDirectory :: FilePath -> Annex ()
createAnnexDirectory dir = traverse dir [] =<< top
where
- top = takeDirectory <$> fromRepo gitAnnexDir
+ top = parentDir <$> fromRepo gitAnnexDir
traverse d below stop
| d `equalFilePath` stop = done
| otherwise = ifM (liftIO $ doesDirectoryExist d)
( done
- , traverse (takeDirectory d) (d:below) stop
+ , traverse (parentDir d) (d:below) stop
)
where
done = forM_ below $ \p -> do
@@ -92,14 +92,14 @@ freezeContentDir :: FilePath -> Annex ()
freezeContentDir file = unlessM crippledFileSystem $
liftIO . go =<< fromRepo getSharedRepository
where
- dir = takeDirectory file
+ dir = parentDir file
go GroupShared = groupWriteRead dir
go AllShared = groupWriteRead dir
go _ = preventWrite dir
thawContentDir :: FilePath -> Annex ()
thawContentDir file = unlessM crippledFileSystem $
- liftIO $ allowWrite $ takeDirectory file
+ liftIO $ allowWrite $ parentDir file
{- Makes the directory tree to store an annexed file's content,
- with appropriate permissions on each level. -}
@@ -111,7 +111,7 @@ createContentDir dest = do
unlessM crippledFileSystem $
liftIO $ allowWrite dir
where
- dir = takeDirectory dest
+ dir = parentDir dest
{- Creates the content directory for a file if it doesn't already exist,
- or thaws it if it does, then runs an action to modify the file, and