refactor
This commit is contained in:
parent
7c73b7584d
commit
11ca4cee34
2 changed files with 8 additions and 6 deletions
|
@ -353,8 +353,7 @@ removeAnnex :: Key -> Annex ()
|
|||
removeAnnex key = withObjectLoc key remove removedirect
|
||||
where
|
||||
remove file = do
|
||||
unlessM crippledFileSystem $
|
||||
liftIO $ allowWrite $ parentDir file
|
||||
thawContentDir file
|
||||
liftIO $ nukeFile file
|
||||
removeInodeCache key
|
||||
cleanObjectLoc key
|
||||
|
@ -374,8 +373,7 @@ removeAnnex key = withObjectLoc key remove removedirect
|
|||
fromAnnex :: Key -> FilePath -> Annex ()
|
||||
fromAnnex key dest = do
|
||||
file <- calcRepo $ gitAnnexLocation key
|
||||
unlessM crippledFileSystem $
|
||||
liftIO $ allowWrite $ parentDir file
|
||||
thawContentDir file
|
||||
thawContent file
|
||||
liftIO $ moveFile file dest
|
||||
cleanObjectLoc key
|
||||
|
@ -388,8 +386,7 @@ moveBad key = do
|
|||
bad <- fromRepo gitAnnexBadDir
|
||||
let dest = bad </> takeFileName src
|
||||
createAnnexDirectory (parentDir dest)
|
||||
unlessM crippledFileSystem $
|
||||
liftIO $ allowWrite (parentDir src)
|
||||
thawContentDir src
|
||||
liftIO $ moveFile src dest
|
||||
cleanObjectLoc key
|
||||
logStatus key InfoMissing
|
||||
|
|
|
@ -12,6 +12,7 @@ module Annex.Perms (
|
|||
noUmask,
|
||||
createContentDir,
|
||||
freezeContentDir,
|
||||
thawContentDir,
|
||||
) where
|
||||
|
||||
import Common.Annex
|
||||
|
@ -87,6 +88,10 @@ freezeContentDir file = unlessM crippledFileSystem $
|
|||
go AllShared = groupWriteRead dir
|
||||
go _ = preventWrite dir
|
||||
|
||||
thawContentDir :: FilePath -> Annex ()
|
||||
thawContentDir file = unlessM crippledFileSystem $
|
||||
liftIO $ allowWrite $ parentDir file
|
||||
|
||||
{- Makes the directory tree to store an annexed file's content,
|
||||
- with appropriate permissions on each level. -}
|
||||
createContentDir :: FilePath -> Annex ()
|
||||
|
|
Loading…
Reference in a new issue