aboutsummaryrefslogtreecommitdiff
path: root/Command/Migrate.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-02-14 16:54:36 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-02-14 16:54:36 -0400
commit99ea159fce3fb98080b5e39770fc22b79d58d50f (patch)
treec988f5fb17d3183b05fa6dabde78c4d7ea7ac829 /Command/Migrate.hs
parent5fc9ccdaa5c73ec424de175962f98cc8fd63eca0 (diff)
add: Improved detection of files that are modified while being added.
In indirect mode, now checks the inode cache to detect changes to a file. Note that a file can still be changed if a process has it open for write, after landing in the annex. In direct mode, some checking of the inode cache was done before, but from a much later point, so fewer modifications could be detected. Now it's as good as indirect mode. On crippled filesystems, no lock down is done before starting to add a file, so checking the inode cache is the only protection we have.
Diffstat (limited to 'Command/Migrate.hs')
-rw-r--r--Command/Migrate.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Command/Migrate.hs b/Command/Migrate.hs
index f3ff0dd72..5374bc928 100644
--- a/Command/Migrate.hs
+++ b/Command/Migrate.hs
@@ -63,5 +63,9 @@ perform file oldkey oldbackend newbackend = do
next $ Command.ReKey.cleanup file oldkey newkey
genkey = do
content <- inRepo $ gitAnnexLocation oldkey
- let source = KeySource { keyFilename = file, contentLocation = content }
+ let source = KeySource
+ { keyFilename = file
+ , contentLocation = content
+ , inodeCache = Nothing
+ }
liftM fst <$> genKey source (Just newbackend)