This commit is contained in:
Joey Hess 2011-10-31 16:46:51 -04:00
parent 00988bcf36
commit 3d2a9f8405
11 changed files with 48 additions and 54 deletions

View file

@ -38,11 +38,10 @@ start p@(_, file) = notBareRepo $ notAnnexed file $ do
next $ perform p
perform :: BackendFile -> CommandPerform
perform (backend, file) = do
k <- Backend.genKey file backend
case k of
Nothing -> stop
Just (key, _) -> do
perform (backend, file) = Backend.genKey file backend >>= go
where
go Nothing = stop
go (Just (key, _)) = do
handle (undo file key) $ moveAnnex key file
next $ cleanup file key True
@ -75,9 +74,9 @@ cleanup file key hascontent = do
-- touch the symlink to have the same mtime as the
-- file it points to
s <- liftIO $ getFileStatus file
let mtime = modificationTime s
liftIO $ touch file (TimeSpec mtime) False
liftIO $ do
mtime <- modificationTime <$> getFileStatus file
touch file (TimeSpec mtime) False
force <- Annex.getState Annex.force
if force