diff options
author | Joey Hess <joey@kitenet.net> | 2013-11-05 16:42:59 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-11-05 17:05:03 -0400 |
commit | 4f6c8222072ace33e3acedddd31637089ae474b6 (patch) | |
tree | 720d851820dd6ccc51e5393f2dc87818141ec2ed /Init.hs | |
parent | da9eea5dc0e86b4abb14064346eddc5689d94333 (diff) |
v5 for direct mode, with automatic upgrade
This includes storing the current state of the HEAD ref, which git annex
sync is going to need, but does not make sync use it.
Diffstat (limited to 'Init.hs')
-rw-r--r-- | Init.hs | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -35,6 +35,7 @@ import Utility.UserInfo import Utility.FileMode #endif import Annex.Hook +import Upgrade genDescription :: Maybe String -> Annex String genDescription (Just d) = return d @@ -74,9 +75,12 @@ uninitialize = do {- Will automatically initialize if there is already a git-annex - branch from somewhere. Otherwise, require a manual init - to avoid git-annex accidentially being run in git - - repos that did not intend to use it. -} + - repos that did not intend to use it. + - + - Checks repository version and handles upgrades too. + -} ensureInitialized :: Annex () -ensureInitialized = getVersion >>= maybe needsinit checkVersion +ensureInitialized = getVersion >>= maybe needsinit checkUpgrade where needsinit = ifM Annex.Branch.hasSibling ( initialize Nothing |