Rewrite GitMoveDeleteHook to use DirCacheBuilder
commit3ffa47d9294086fbd1cdeb9b1564f922a23e3c6f
authorShawn O. Pearce <spearce@spearce.org>
Tue, 12 Aug 2008 01:08:10 +0000 (11 18:08 -0700)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Thu, 14 Aug 2008 17:33:21 +0000 (14 19:33 +0200)
tree215bbf268dfe028d32596f318b99bc4d2d299a56
parent9d424a82f34de89920dee8ca4a45d42eafe55724
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>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.egit.core/src/org/spearce/egit/core/GitMoveDeleteHook.java