-static void record_rename_pair(struct diff_queue_struct *outq,
- struct diff_filespec *src,
- struct diff_filespec *dst,
- int rank,
- int score)
-{
- /* The rank is used to sort the final output, because there
- * are certain dependencies.
- *
- * - rank #0 depends on deleted ones.
- * - rank #1 depends on kept files before they are modified.
- * - rank #2 depends on kept files after they are modified;
- * currently not used.
- *
- * Therefore, the final output order should be:
- *
- * 1. rank #0 rename/copy diffs.
- * 2. deletions in the original.
- * 3. rank #1 rename/copy diffs.
- * 4. additions and modifications in the original.
- * 5. rank #2 rename/copy diffs; currently not used.
- *
- * To achieve this sort order, we give xform_work the number
- * above.
- */
- struct diff_filepair *dp = diff_queue(outq, src, dst);
- dp->xfrm_work = (rank * 2 + 1) | (score<<RENAME_SCORE_SHIFT);
- dst->xfrm_flags |= RENAME_DST_MATCHED;
-}
-
-#if 0
-static void debug_filespec(struct diff_filespec *s, int x, const char *one)
-{
- fprintf(stderr, "queue[%d] %s (%s) %s %06o %s\n",
- x, one,
- s->path,
- DIFF_FILE_VALID(s) ? "valid" : "invalid",
- s->mode,
- s->sha1_valid ? sha1_to_hex(s->sha1) : "");
- fprintf(stderr, "queue[%d] %s size %lu flags %d\n",
- x, one,
- s->size, s->xfrm_flags);
-}
-
-static void debug_filepair(const struct diff_filepair *p, int i)
-{
- debug_filespec(p->one, i, "one");
- debug_filespec(p->two, i, "two");
- fprintf(stderr, "pair flags %d, orig order %d, score %d\n",
- (p->xfrm_work & ((1<<RENAME_SCORE_SHIFT) - 1)),
- p->orig_order,
- (p->xfrm_work >> RENAME_SCORE_SHIFT));
-}