sequencer: lib'ify checkout_fast_forward()
[gitweb.git] / diffcore-rename.c
index 22b239a43ab2966aa3581b434e4a336f542f12e2..73d003a08ae72d0c8f18b16172bc09c86022eb8f 100644 (file)
@@ -60,7 +60,7 @@ static int add_rename_dst(struct diff_filespec *two)
                memmove(rename_dst + first + 1, rename_dst + first,
                        (rename_dst_nr - first - 1) * sizeof(*rename_dst));
        rename_dst[first].two = alloc_filespec(two->path);
-       fill_filespec(rename_dst[first].two, two->oid.hash, two->sha1_valid,
+       fill_filespec(rename_dst[first].two, two->oid.hash, two->oid_valid,
                      two->mode);
        rename_dst[first].pair = NULL;
        return 0;
@@ -261,7 +261,7 @@ struct file_similarity {
 
 static unsigned int hash_filespec(struct diff_filespec *filespec)
 {
-       if (!filespec->sha1_valid) {
+       if (!filespec->oid_valid) {
                if (diff_populate_filespec(filespec, 0))
                        return 0;
                hash_sha1_file(filespec->data, filespec->size, "blob",
@@ -541,7 +541,7 @@ void diffcore_rename(struct diff_options *options)
                                rename_dst_nr * rename_src_nr, 50, 1);
        }
 
-       mx = xcalloc(st_mult(num_create, NUM_CANDIDATE_PER_DST), sizeof(*mx));
+       mx = xcalloc(st_mult(NUM_CANDIDATE_PER_DST, num_create), sizeof(*mx));
        for (dst_cnt = i = 0; i < rename_dst_nr; i++) {
                struct diff_filespec *two = rename_dst[i].two;
                struct diff_score *m;