~ubuntu-branches/ubuntu/intrepid/git-core/intrepid-updates

« back to all changes in this revision

Viewing changes to diffcore-rename.c

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-04-22 13:31:05 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20070422133105-tkmhz328g2p0epz1
Tags: 1:1.5.1.2-1
* new upstream point release.
* debian/changelog.upstream: upstream changes taken from mailing list
  announcement.

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
                return 0;
110
110
        if (src->size != dst->size)
111
111
                return 0;
 
112
        if (src->sha1_valid && dst->sha1_valid)
 
113
            return !hashcmp(src->sha1, dst->sha1);
112
114
        if (diff_populate_filespec(src, 0) || diff_populate_filespec(dst, 0))
113
115
                return 0;
114
116
        if (src->size == dst->size &&
170
172
                return 0; /* error but caught downstream */
171
173
 
172
174
 
173
 
        delta_limit = base_size * (MAX_SCORE-minimum_score) / MAX_SCORE;
 
175
        delta_limit = (unsigned long)
 
176
                (base_size * (MAX_SCORE-minimum_score) / MAX_SCORE);
174
177
        if (diffcore_count_changes(src->data, src->size,
175
178
                                   dst->data, dst->size,
176
179
                                   &src->cnt_data, &dst->cnt_data,
184
187
        if (!dst->size)
185
188
                score = 0; /* should not happen */
186
189
        else
187
 
                score = src_copied * MAX_SCORE / max_size;
 
190
                score = (int)(src_copied * MAX_SCORE / max_size);
188
191
        return score;
189
192
}
190
193
 
295
298
                                struct diff_filespec *one = rename_src[j].one;
296
299
                                if (!is_exact_match(one, two, contents_too))
297
300
                                        continue;
298
 
                                record_rename_pair(i, j, MAX_SCORE);
 
301
                                record_rename_pair(i, j, (int)MAX_SCORE);
299
302
                                rename_count++;
300
303
                                break; /* we are done with this entry */
301
304
                        }