v6: fix migrate of unlocked file
After commit b2bafdb2fc
the test suite
threw up a failure migrating unlocked files.
I'm not clear how that commit broke it (presumably by inAnnex reporting
the right information now), but the actual problem is plain:
The inodecache for the worktree file is generated, but then the file is
replaced with a copy (unncessarily unless annex.link is set, but the
code always does so) and so linkToAnnex/linkAnnex then fails because it
notices the inode cache is not valid.
This commit was sponsored by Jake Vosloo on Patreon.
This commit is contained in:
parent
bdf6783b92
commit
220317df5a
1 changed files with 1 additions and 1 deletions
|
@ -87,7 +87,6 @@ linkKey file oldkey newkey = ifM (isJust <$> isAnnexLink file)
|
|||
oldobj <- calcRepo (gitAnnexLocation oldkey)
|
||||
isJust <$> linkOrCopy' (return True) newkey oldobj tmp Nothing
|
||||
, do
|
||||
ic <- withTSDelta (liftIO . genInodeCache file)
|
||||
{- The file being rekeyed is itself an unlocked file, so if
|
||||
- it's linked to the old key, that link must be broken. -}
|
||||
oldobj <- calcRepo (gitAnnexLocation oldkey)
|
||||
|
@ -99,6 +98,7 @@ linkKey file oldkey newkey = ifM (isJust <$> isAnnexLink file)
|
|||
oldic <- withTSDelta (liftIO . genInodeCache oldobj)
|
||||
whenM (isUnmodified oldkey oldobj) $
|
||||
Database.Keys.addInodeCaches oldkey (catMaybes [oldic])
|
||||
ic <- withTSDelta (liftIO . genInodeCache file)
|
||||
case v of
|
||||
Left e -> do
|
||||
warning (show e)
|
||||
|
|
Loading…
Reference in a new issue