Fix a case where upgrade to v7 caused git to think that unlocked files were modified
When a file was already unlocked, but the annex object was present, the upgrade process populated the unlocked file, but neglected to update the index. This commit was sponsored by Jochen Bartl on Patreon.
This commit is contained in:
parent
38dad58c85
commit
11dbb829bc
3 changed files with 19 additions and 4 deletions
|
@ -14,6 +14,8 @@ import Annex.Version
|
||||||
import Annex.Content
|
import Annex.Content
|
||||||
import Annex.ReplaceFile
|
import Annex.ReplaceFile
|
||||||
import Annex.CurrentBranch
|
import Annex.CurrentBranch
|
||||||
|
import Annex.InodeSentinal
|
||||||
|
import Utility.InodeCache
|
||||||
import Config
|
import Config
|
||||||
import Git.FilePath
|
import Git.FilePath
|
||||||
import qualified Git.Ref
|
import qualified Git.Ref
|
||||||
|
@ -84,9 +86,13 @@ scanUnlockedFiles = whenM (isJust <$> inRepo Git.Branch.current) $ do
|
||||||
whenM (inAnnex k) $ do
|
whenM (inAnnex k) $ do
|
||||||
f <- fromRepo $ fromTopFilePath tf
|
f <- fromRepo $ fromTopFilePath tf
|
||||||
destmode <- liftIO $ catchMaybeIO $ fileMode <$> getFileStatus f
|
destmode <- liftIO $ catchMaybeIO $ fileMode <$> getFileStatus f
|
||||||
replaceFile f $ \tmp ->
|
ic <- replaceFile f $ \tmp ->
|
||||||
linkFromAnnex k tmp destmode >>= \case
|
linkFromAnnex k tmp destmode >>= \case
|
||||||
LinkAnnexOk -> return ()
|
LinkAnnexOk ->
|
||||||
LinkAnnexNoop -> return ()
|
withTSDelta (liftIO . genInodeCache tmp)
|
||||||
LinkAnnexFailed -> liftIO $
|
LinkAnnexNoop -> return Nothing
|
||||||
|
LinkAnnexFailed -> liftIO $ do
|
||||||
writePointerFile tmp k destmode
|
writePointerFile tmp k destmode
|
||||||
|
return Nothing
|
||||||
|
liftIO $ print ic
|
||||||
|
maybe noop (restagePointerFile (Restage True) f) ic
|
||||||
|
|
|
@ -13,6 +13,8 @@ git-annex (7.20181206) UNRELEASED; urgency=medium
|
||||||
* webdav: When initializing, avoid trying to make a directory at the top of
|
* webdav: When initializing, avoid trying to make a directory at the top of
|
||||||
the webdav server, which could never accomplish anything and failed on
|
the webdav server, which could never accomplish anything and failed on
|
||||||
nextcloud servers. (Reversion introduced in version 6.20170925.)
|
nextcloud servers. (Reversion introduced in version 6.20170925.)
|
||||||
|
* Fix a case where upgrade to v7 caused git to think that unlocked files
|
||||||
|
were modified.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Thu, 06 Dec 2018 13:39:16 -0400
|
-- Joey Hess <id@joeyh.name> Thu, 06 Dec 2018 13:39:16 -0400
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
[[!comment format=mdwn
|
||||||
|
username="joey"
|
||||||
|
subject="""comment 5"""
|
||||||
|
date="2018-12-11T17:03:38Z"
|
||||||
|
content="""
|
||||||
|
Fixed the problem I described.
|
||||||
|
"""]]
|
Loading…
Reference in a new issue