fix upgrade when .git-annex has already been entirely converted
This commit is contained in:
parent
ad38c0dfad
commit
d7018500fa
1 changed files with 8 additions and 6 deletions
|
@ -9,7 +9,7 @@ module Upgrade.V2 where
|
||||||
|
|
||||||
import System.Directory
|
import System.Directory
|
||||||
import System.FilePath
|
import System.FilePath
|
||||||
import Control.Monad.State (unless, liftIO)
|
import Control.Monad.State (unless, when, liftIO)
|
||||||
import List
|
import List
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
|
|
||||||
|
@ -50,11 +50,13 @@ upgrade = do
|
||||||
let bare = Git.repoIsLocalBare g
|
let bare = Git.repoIsLocalBare g
|
||||||
|
|
||||||
Branch.create
|
Branch.create
|
||||||
mapM_ (\(k, f) -> inject f $ logFile k) =<< locationLogs g
|
e <- liftIO $ doesDirectoryExist (olddir g)
|
||||||
mapM_ (\f -> inject f f) =<< logFiles (olddir g)
|
when e $ do
|
||||||
liftIO $ do
|
mapM_ (\(k, f) -> inject f $ logFile k) =<< locationLogs g
|
||||||
Git.run g "rm" [Param "-r", Param "-f", Param "-q", File (olddir g)]
|
mapM_ (\f -> inject f f) =<< logFiles (olddir g)
|
||||||
unless bare $ gitAttributesUnWrite g
|
liftIO $ do
|
||||||
|
Git.run g "rm" [Param "-r", Param "-f", Param "-q", File (olddir g)]
|
||||||
|
unless bare $ gitAttributesUnWrite g
|
||||||
|
|
||||||
saveState
|
saveState
|
||||||
unless bare $ push
|
unless bare $ push
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue