From 65977a558446fd4208b04614191b68bae838b044 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 May 2012 17:01:22 -0400 Subject: 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. --- Command/Lock.hs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'Command') diff --git a/Command/Lock.hs b/Command/Lock.hs index b8aedb252..ab97b14bc 100644 --- a/Command/Lock.hs +++ b/Command/Lock.hs @@ -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 -- cgit v1.2.3