diffcore-rename.c: move code around to prepare for the next patch

No actual code changes, just move hash_filespec up and outdent part of
find_identical_files.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Karsten Blees 2013-11-14 20:19:04 +01:00 committed by Junio C Hamano
parent 29d8a834b5
commit 48f6407ffe
1 changed files with 47 additions and 47 deletions

View File

@ -248,6 +248,18 @@ struct file_similarity {
struct file_similarity *next; struct file_similarity *next;
}; };


static unsigned int hash_filespec(struct diff_filespec *filespec)
{
unsigned int hash;
if (!filespec->sha1_valid) {
if (diff_populate_filespec(filespec, 0))
return 0;
hash_sha1_file(filespec->data, filespec->size, "blob", filespec->sha1);
}
memcpy(&hash, filespec->sha1, sizeof(hash));
return hash;
}

static int find_identical_files(struct file_similarity *src, static int find_identical_files(struct file_similarity *src,
struct file_similarity *dst, struct file_similarity *dst,
struct diff_options *options) struct diff_options *options)
@ -343,18 +355,6 @@ static int find_same_files(void *ptr, void *data)
return ret; return ret;
} }


static unsigned int hash_filespec(struct diff_filespec *filespec)
{
unsigned int hash;
if (!filespec->sha1_valid) {
if (diff_populate_filespec(filespec, 0))
return 0;
hash_sha1_file(filespec->data, filespec->size, "blob", filespec->sha1);
}
memcpy(&hash, filespec->sha1, sizeof(hash));
return hash;
}

static void insert_file_table(struct hash_table *table, int src_dst, int index, struct diff_filespec *filespec) static void insert_file_table(struct hash_table *table, int src_dst, int index, struct diff_filespec *filespec)
{ {
void **pos; void **pos;