diff --git a/Annex/Init.hs b/Annex/Init.hs index 1bc82710f4..a762bf690c 100644 --- a/Annex/Init.hs +++ b/Annex/Init.hs @@ -108,9 +108,9 @@ initialize' mversion = checkCanInitialize $ do unlessM (isJust <$> getVersion) $ setVersion (fromMaybe defaultVersion mversion) configureSmudgeFilter - showSideAction "scanning for unlocked files" - scanUnlockedFiles unlessM isBareRepo $ do + showSideAction "scanning for unlocked files" + scanUnlockedFiles hookWrite postCheckoutHook hookWrite postMergeHook AdjustedBranch.checkAdjustedClone >>= \case diff --git a/Annex/WorkTree.hs b/Annex/WorkTree.hs index cf40f527bf..b04eeac4d8 100644 --- a/Annex/WorkTree.hs +++ b/Annex/WorkTree.hs @@ -22,6 +22,7 @@ import qualified Git.Types import Database.Types import qualified Database.Keys import qualified Database.Keys.SQL +import Config {- Looks up the key corresponding to an annexed file in the work tree, - by examining what the file links to. @@ -75,7 +76,7 @@ ifAnnexed file yes no = maybe no yes =<< lookupFile file - as-is. -} scanUnlockedFiles :: Annex () -scanUnlockedFiles = whenM (inRepo Git.Ref.headExists) $ do +scanUnlockedFiles = whenM (inRepo Git.Ref.headExists <&&> not <$> isBareRepo) $ do Database.Keys.runWriter $ liftIO . Database.Keys.SQL.dropAllAssociatedFiles (l, cleanup) <- inRepo $ Git.LsTree.lsTree Git.LsTree.LsTreeRecursive Git.Ref.headRef