avoid writing new line to upgrade.log when upgrade is deferred
With automatic upgrades to v10 enabled, this could have led to each run of git-annex adding a line to upgrade.log for v9. However, they're not yet, so it only happened when running git-annex upgrade in a v9 repository. Sponsored-by: Brock Spratlen on Patreon
This commit is contained in:
parent
61b55d62d7
commit
df3020fb7e
1 changed files with 4 additions and 3 deletions
|
@ -67,10 +67,11 @@ needsUpgrade v
|
|||
|
||||
upgrade :: Bool -> RepoVersion -> Annex Bool
|
||||
upgrade automatic destversion = do
|
||||
(upgraded, newversion) <- go =<< getVersion
|
||||
when upgraded $
|
||||
startversion <- getVersion
|
||||
(ok, newversion) <- go startversion
|
||||
when (ok && newversion /= startversion) $
|
||||
postupgrade newversion
|
||||
return upgraded
|
||||
return ok
|
||||
where
|
||||
go (Just v)
|
||||
| v >= destversion = return (True, Just v)
|
||||
|
|
Loading…
Reference in a new issue