lock: Reset unlocked file to index, rather than to branch head.

Resetting an unlocked file to the branch head failed if it had just been
added, not committed, and unlocked, since the branch didbn't have it.

The code was concerned about dropping any changes that might be staged in the
index, but I cannot see why.
This commit is contained in:
Joey Hess 2012-05-30 17:01:22 -04:00
parent 96f00bafd0
commit 65977a5584
3 changed files with 6 additions and 7 deletions

View file

@ -24,9 +24,5 @@ start file = do
perform :: FilePath -> CommandPerform
perform file = do
liftIO $ removeFile file
-- Checkout from HEAD to get rid of any changes that might be
-- staged in the index, and get back to the previous symlink to
-- the content.
Annex.Queue.add "checkout" [Param "HEAD", Param "--"] [file]
Annex.Queue.add "checkout" [Param "--"] [file]
next $ return True -- no cleanup needed