Annexed file contents are now made unwritable and put in unwriteable directories, to avoid them accidentially being removed or modified. (Thanks Josh Triplett for the idea.)
This commit is contained in:
parent
8dd9f8e49e
commit
1d32d902c9
8 changed files with 74 additions and 49 deletions
|
@ -9,12 +9,9 @@ module Command.Add where
|
|||
|
||||
import Control.Monad.State (liftIO)
|
||||
import System.Posix.Files
|
||||
import System.Directory
|
||||
|
||||
import Command
|
||||
import qualified Annex
|
||||
import Utility
|
||||
import Locations
|
||||
import qualified Backend
|
||||
import LocationLog
|
||||
import Types
|
||||
|
@ -42,11 +39,9 @@ perform (file, backend) = do
|
|||
|
||||
cleanup :: FilePath -> Key -> SubCmdCleanup
|
||||
cleanup file key = do
|
||||
moveAnnex key file
|
||||
logStatus key ValuePresent
|
||||
g <- Annex.gitRepo
|
||||
let dest = annexLocation g key
|
||||
liftIO $ createDirectoryIfMissing True (parentDir dest)
|
||||
liftIO $ renameFile file dest
|
||||
|
||||
link <- calcGitLink file key
|
||||
liftIO $ createSymbolicLink link file
|
||||
Annex.queue "add" [] file
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue