perf: Optimize away a few more calls to 'git' when unstaging
commitaba3869285d4b3a016abc18384cba09a7ecebef4
authorDavid Aguilar <davvid@gmail.com>
Wed, 5 May 2010 22:32:28 +0000 (5 15:32 -0700)
committerDavid Aguilar <davvid@gmail.com>
Wed, 5 May 2010 22:32:57 +0000 (5 15:32 -0700)
tree234a89a4361aa8481c239f009e6d901a58e919c9
parent378a08c16536d119b5a3e319071d0fa5bd2f14be
perf: Optimize away a few more calls to 'git' when unstaging

The unstaging operation no longer calls any of the following:

git update-index --refresh
git diff-index --cached HEAD
git diff-index HEAD

We now simply unstage the file using 'git reset' and then ask
git for the list of all files using 'git ls-files -z'.

We can then classify each unstaged path as being either
modified or untracked based solely on whether or not each
path is a member of the set of known files.

This should noticibly speed things up when working with large
repositories.

Closes #48

Signed-off-by: David Aguilar <davvid@gmail.com>
cola/commands.py
cola/gitcmds.py
cola/models/main.py