avoid setting annex.direct in bare repo (no behavior change, just less ugly)

This commit is contained in:
Joey Hess 2013-06-10 13:18:18 -04:00
parent a64106dcef
commit 952537166e

19
Init.hs
View file

@ -160,15 +160,16 @@ checkCrippledFileSystem = whenM probeCrippledFileSystem $ do
setConfig (ConfigKey "core.symlinks") setConfig (ConfigKey "core.symlinks")
(Git.Config.boolConfig False) (Git.Config.boolConfig False)
unlessM isDirect $ do unlessBare $ do
warning "Enabling direct mode." unlessM isDirect $ do
top <- fromRepo Git.repoPath warning "Enabling direct mode."
(l, clean) <- inRepo $ Git.LsFiles.inRepo [top] top <- fromRepo Git.repoPath
forM_ l $ \f -> (l, clean) <- inRepo $ Git.LsFiles.inRepo [top]
maybe noop (`toDirect` f) =<< isAnnexLink f forM_ l $ \f ->
void $ liftIO clean maybe noop (`toDirect` f) =<< isAnnexLink f
setDirect True void $ liftIO clean
setVersion directModeVersion setDirect True
setVersion directModeVersion
probeFifoSupport :: Annex Bool probeFifoSupport :: Annex Bool
probeFifoSupport = do probeFifoSupport = do