Optimize both pre-commit and lock subcommands.

isLocked was doing the expensive check before the cheap one. Let's not
fork git diff twice per file when committing, especially.

git diff is still run more than strictly necessary (ie, more than once)
if multiple unlocked files are being committed. But much better now.
This commit is contained in:
Joey Hess 2010-11-11 14:54:29 -04:00
parent 8a8987579f
commit dffe949963
3 changed files with 19 additions and 10 deletions

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
git-annex (0.05) UNRELEASED; urgency=low
* Optimize both pre-commit and lock subcommands.
-- Joey Hess <joeyh@debian.org> Thu, 11 Nov 2010 14:52:05 -0400
git-annex (0.04) unstable; urgency=low
* Add unlock subcommand, which replaces the symlink with a copy of