diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-12-22 15:20:03 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-12-22 15:20:03 -0400 |
commit | 00e240f3803384ae8761f2d5bc95319351f4e0fa (patch) | |
tree | 67a9639c72a8bd8239abb377d77962f4ba9c2a5a /Upgrade | |
parent | 0da2a837d1634164695591029072b88cd56b46e7 (diff) |
make linkAnnex detect when the file changes as it's being copied/linked in
This fixes a race where the modified file ended up in annex/objects, and
the InodeCache stored in the database was for the modified version, so
git-annex didn't know it had gotten modified.
The race could occur when the smudge filter was running; now it gets the
InodeCache before generating the Key, which avoids the race.
Diffstat (limited to 'Upgrade')
-rw-r--r-- | Upgrade/V5.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Upgrade/V5.hs b/Upgrade/V5.hs index 2073a0150..f6d18df43 100644 --- a/Upgrade/V5.hs +++ b/Upgrade/V5.hs @@ -20,6 +20,7 @@ import qualified Git import qualified Git.LsFiles import qualified Git.Branch import Git.FileMode +import Utility.InodeCache upgrade :: Bool -> Annex Bool upgrade automatic = do @@ -88,7 +89,8 @@ upgradeDirectWorkTree = do -- not populated with it. Since the work tree file -- is recorded as an associated file, things will still -- work that way, it's just not ideal. - void $ linkAnnex k f + ic <- withTSDelta (liftIO . genInodeCache f) + void $ linkAnnex k f ic writepointer f k = liftIO $ do nukeFile f writeFile f (formatPointer k) |