diff options
author | Joey Hess <joey@kitenet.net> | 2013-02-15 18:16:50 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-02-15 18:16:50 -0400 |
commit | 03889cb48c3c9a0eb02f1a364ddfbb26c401fcaa (patch) | |
tree | 6ebd263ffad7519ea16c748d2010e39e377342b1 /Init.hs | |
parent | 2ff051dd2173e773dfda5d1f0bf6c6b407705580 (diff) |
switch to direct mode when auto-enabling
Gets the direct mode mapping set up correctly. Maybe other stuff, but
probably not, since this is probably a new repo.
Diffstat (limited to 'Init.hs')
-rw-r--r-- | Init.hs | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -17,6 +17,7 @@ import Common.Annex import Utility.TempFile import Utility.Network import qualified Git +import qualified Git.LsFiles import qualified Annex.Branch import Logs.UUID import Annex.Version @@ -25,6 +26,8 @@ import Utility.UserInfo import Utility.Shell import Utility.FileMode import Config +import Annex.Direct +import Backend genDescription :: Maybe String -> Annex String genDescription (Just d) = return d @@ -127,6 +130,13 @@ probeCrippledFileSystem = do checkCrippledFileSystem :: Annex () checkCrippledFileSystem = whenM (probeCrippledFileSystem) $ do - warning "Detected a crippled filesystem. Enabling direct mode." - setDirect True + warning "Detected a crippled filesystem." setCrippledFileSystem True + unlessM isDirect $ do + warning "Enabling direct mode." + top <- fromRepo Git.repoPath + (l, clean) <- inRepo $ Git.LsFiles.inRepo [top] + forM_ l $ \f -> + maybe noop (`toDirect` f) =<< isAnnexLink f + void $ liftIO clean + setDirect True |