diff options
author | Joey Hess <joey@kitenet.net> | 2013-11-26 12:54:50 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-11-26 12:54:50 -0400 |
commit | 01c0042f39068e43443e667edbde15205f738608 (patch) | |
tree | af7c9a0971a446d7dcda41bb698f04ed5fce3b00 /Upgrade.hs | |
parent | 2e3acd1831b56662efcb957616210697afc195ff (diff) |
Bug fix: annex.version did not get set on automatic upgrade to v5 direct mode repo, so the upgrade was performed repeatedly, slowing commands down.
Diffstat (limited to 'Upgrade.hs')
-rw-r--r-- | Upgrade.hs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Upgrade.hs b/Upgrade.hs index fe5dd887d..7385268e8 100644 --- a/Upgrade.hs +++ b/Upgrade.hs @@ -1,6 +1,6 @@ {- git-annex upgrade support - - - Copyright 2010 Joey Hess <joey@kitenet.net> + - Copyright 2010, 2013 Joey Hess <joey@kitenet.net> - - Licensed under the GNU GPL version 3 or higher. -} @@ -11,6 +11,7 @@ module Upgrade where import Common.Annex import Annex.Version +import Config #ifndef mingw32_HOST_OS import qualified Upgrade.V0 import qualified Upgrade.V1 @@ -36,7 +37,14 @@ needsUpgrade v ok = return Nothing upgrade :: Bool -> Annex Bool -upgrade automatic = go =<< getVersion +upgrade automatic = do + upgraded <- go =<< getVersion + when upgraded $ + ifM isDirect + ( setVersion directModeVersion + , setVersion defaultVersion + ) + return upgraded where #ifndef mingw32_HOST_OS go (Just "0") = Upgrade.V0.upgrade |