New "diff-cache" implementation.

This one is about a million times simpler, and much more likely to be
correct too.

Instead of trying to match up a tree object against the index, we just
read in the tree object side-by-side into the index, and just walk the
resulting index file. This was what all the read-tree cleanups were
all getting to.
This commit is contained in:
Linus Torvalds
2005-04-22 17:15:28 -07:00
parent 94537c78a8
commit b5af910727
3 changed files with 58 additions and 182 deletions

View File

@ -87,7 +87,7 @@ int cache_name_pos(const char *name, int namelen)
}
/* Remove entry, return true if there are more entries to go.. */
static int remove_entry_at(int pos)
int remove_entry_at(int pos)
{
active_nr--;
if (pos >= active_nr)
@ -106,7 +106,7 @@ int remove_file_from_cache(char *path)
return 0;
}
static int same_name(struct cache_entry *a, struct cache_entry *b)
int same_name(struct cache_entry *a, struct cache_entry *b)
{
int len = ce_namelen(a);
return ce_namelen(b) == len && !memcmp(a->name, b->name, len);