Rewrite GitMoveDeleteHook to use DirCacheBuilder
The new DirCache API can read and write an index file faster than
the older GitIndex API can. Its slightly more verbose to use but
operations will execute more quickly, especially when we are forced
to perform these single path updates by Eclipse.
When we move a file we maintain its stage status. If the file has
been modified on disk but is not yet staged into the index (or it
was modified since staging) we leave the index alone, retaining
that staged state.
If we are moving within the same index file (same repository) we
only write the index out once. This is a common case as most of
the renames performed by users will be within the same project,
and the same Git repository. It is rare for a rename to wind up
spanning multiple repositories.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Temporary-revert:
bb4dd1f1fa3acc9daae212716e630a0c8ca218a0
Originally:
3ffa47d9294086fbd1cdeb9b1564f922a23e3c6f
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>