Massively sped up git annex lock
by avoiding use of the uber-slow git reset
, and only running git checkout
once, even when many files are being locked.
This commit is contained in:
parent
6e6e77f9c0
commit
fafe60768f
2 changed files with 8 additions and 7 deletions
|
@ -12,8 +12,7 @@ import System.Directory
|
||||||
|
|
||||||
import Command
|
import Command
|
||||||
import Messages
|
import Messages
|
||||||
import qualified Annex
|
import qualified AnnexQueue
|
||||||
import qualified GitRepo as Git
|
|
||||||
import Utility
|
import Utility
|
||||||
|
|
||||||
command :: [Command]
|
command :: [Command]
|
||||||
|
@ -31,9 +30,8 @@ start (file, _) = do
|
||||||
perform :: FilePath -> CommandPerform
|
perform :: FilePath -> CommandPerform
|
||||||
perform file = do
|
perform file = do
|
||||||
liftIO $ removeFile file
|
liftIO $ removeFile file
|
||||||
g <- Annex.gitRepo
|
-- Checkout from HEAD to get rid of any changes that might be
|
||||||
-- first reset the file to drop any changes checked into the index
|
-- staged in the index, and get back to the previous symlink to
|
||||||
liftIO $ Git.run g "reset" [Params "-q --", File file]
|
-- the content.
|
||||||
-- checkout the symlink
|
AnnexQueue.add "checkout" [Param "HEAD", Param "--"] file
|
||||||
liftIO $ Git.run g "checkout" [Param "--", File file]
|
|
||||||
next $ return True -- no cleanup needed
|
next $ return True -- no cleanup needed
|
||||||
|
|
3
debian/changelog
vendored
3
debian/changelog
vendored
|
@ -1,6 +1,9 @@
|
||||||
git-annex (0.20110523) UNRELEASED; urgency=low
|
git-annex (0.20110523) UNRELEASED; urgency=low
|
||||||
|
|
||||||
* Minor bugfixes and error message improvements.
|
* Minor bugfixes and error message improvements.
|
||||||
|
* Massively sped up `git annex lock` by avoiding use of the uber-slow
|
||||||
|
`git reset`, and only running `git checkout` once, even when many files
|
||||||
|
are being locked.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Sat, 28 May 2011 22:29:37 -0400
|
-- Joey Hess <joeyh@debian.org> Sat, 28 May 2011 22:29:37 -0400
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue