assistant direct mode file add/change bookkeeping
When a file is changed in direct mode, the old content is probably lost (at least from the local repo), and bookeeping needs to be updated to reflect this. Also, synthetic add events are generated at assistant startup, so make it detect when the file has not really changed, and avoid re-adding it. This does add the overhead of querying the runing git cat-file for the key that's recorded in git for the file, each time a file is added or modified in direct mode.
This commit is contained in:
parent
221584ec7f
commit
eb40227d15
4 changed files with 39 additions and 7 deletions
|
@ -44,6 +44,6 @@ catFileHandle = maybe startup return =<< Annex.getState Annex.catfilehandle
|
|||
Annex.changeState $ \s -> s { Annex.catfilehandle = Just h }
|
||||
return h
|
||||
|
||||
{- From the Sha of a symlink back to the key. -}
|
||||
catKey :: Sha -> Annex (Maybe Key)
|
||||
catKey sha = fileKey . takeFileName . encodeW8 . L.unpack <$> catObject sha
|
||||
{- From the Sha or Ref of a symlink back to the key. -}
|
||||
catKey :: Ref -> Annex (Maybe Key)
|
||||
catKey ref = fileKey . takeFileName . encodeW8 . L.unpack <$> catObject ref
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue