-static void record_rename_pair(struct diff_queue_struct *outq,
- struct diff_filespec *src,
- struct diff_filespec *dst,
- int rank,
- int score)
-{
- /*
- * These ranks are used to sort the final output, because there
- * are certain dependencies:
- *
- * 1. rename/copy that depends on deleted ones.
- * 2. deletions in the original.
- * 3. rename/copy that depends on the pre-edit image of kept files.
- * 4. additions, modifications and no-modifications in the original.
- * 5. rename/copy that depends on the post-edit image of kept files
- * (note that we currently do not detect such rename/copy).
- *
- * The downstream diffcore transformers are free to reorder
- * the entries as long as they keep file pairs that has the
- * same p->one->path in earlier rename_rank to appear before
- * later ones.
- *
- * To the final output routine, and in the diff-raw format
- * output, a rename/copy that is based on a path that has a
- * later entry that shares the same p->one->path and is not a
- * deletion is a copy. Otherwise it is a rename.
- */
-
- struct diff_filepair *dp = diff_queue(outq, src, dst);
- dp->rename_rank = rank * 2 + 1;
- dp->score = score;
- 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 rank %d, orig order %d, score %d\n",
- p->rename_rank, p->orig_order, p->score);
-}