avoid running scanUnlockedFiles in bare repo
It's not necessary. And if the bare repo somehow has a pointer file in it with the same name as a file in HEAD, that file would be populated, which would be surprising since the file is not really under git's control.
This commit is contained in:
parent
f39e5a4219
commit
740e0ddbfe
2 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue