Rewrite GitMoveDeleteHook to use DirCacheBuilder
commitda715eda0da2a1276584050ecda95f36e0828da7
authorShawn O. Pearce <spearce@spearce.org>
Tue, 12 Aug 2008 01:08:10 +0000 (11 18:08 -0700)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Mon, 13 Apr 2009 21:42:47 +0000 (13 23:42 +0200)
tree30a474278c440e4763fc731eab6c1765502df549
parent7b778e80c3fbf8ab360706b0b7eff15cc6c0c0b6
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>
org.spearce.egit.core/src/org/spearce/egit/core/GitMoveDeleteHook.java