diff options
Diffstat (limited to 'Command/Unannex.hs')
-rw-r--r-- | Command/Unannex.hs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Command/Unannex.hs b/Command/Unannex.hs index 825f81939..d24f921a9 100644 --- a/Command/Unannex.hs +++ b/Command/Unannex.hs @@ -31,8 +31,8 @@ start file = isAnnexed file $ \(key, _) -> do then do force <- Annex.getState Annex.force unless force $ do - g <- gitRepo - staged <- liftIO $ LsFiles.staged g [Git.workTree g] + top <- fromRepo Git.workTree + staged <- inRepo $ LsFiles.staged [top] unless (null staged) $ error "This command cannot be run when there are already files staged for commit." Annex.changeState $ \s -> s { Annex.force = True } @@ -46,19 +46,19 @@ perform file key = next $ cleanup file key cleanup :: FilePath -> Key -> CommandCleanup cleanup file key = do - g <- gitRepo - liftIO $ removeFile file - liftIO $ Git.run g "rm" [Params "--quiet --", File file] + inRepo $ Git.run "rm" [Params "--quiet --", File file] -- git rm deletes empty directories; put them back liftIO $ createDirectoryIfMissing True (parentDir file) fast <- Annex.getState Annex.fast if fast - then liftIO $ do + then do -- fast mode: hard link to content in annex - createLink (gitAnnexLocation g key) file - allowWrite file + src <- fromRepo $ gitAnnexLocation key + liftIO $ do + createLink src file + allowWrite file else do fromAnnex key file logStatus key InfoMissing |