bare repo upgrade support

This commit is contained in:
Joey Hess 2011-03-16 13:16:52 -04:00
parent 1443fcfe02
commit a4bc3d6f38

View file

@ -57,17 +57,21 @@ upgrade :: Annex Bool
upgrade = do upgrade = do
showSideAction "Upgrading object directory layout v1 to v2..." showSideAction "Upgrading object directory layout v1 to v2..."
g <- Annex.gitRepo
if Git.repoIsLocalBare g
then do
moveContent
else do
moveContent moveContent
updateSymlinks updateSymlinks
moveLocationLogs moveLocationLogs
setVersion
-- add new line to auto-merge hashed location logs -- add new line to auto-merge hashed location logs
-- this commits, so has to come after the upgrade -- this commits, so has to come after the upgrade
g <- Annex.gitRepo g <- Annex.gitRepo
liftIO $ Command.Init.gitAttributesWrite g liftIO $ Command.Init.gitAttributesWrite g
setVersion
return True return True
moveContent :: Annex () moveContent :: Annex ()