diff-files: -1/-2/-3 to diff against unmerged stage.
[gitweb.git] / diffcore-rename.c
index e17dd90058443ea75321f8c48818bd0094bd76a3..dba965c0b4006251b1da04465d319c5fe9997ea4 100644 (file)
@@ -283,7 +283,7 @@ void diffcore_rename(struct diff_options *options)
                        register_rename_src(p->one, 1);
        }
        if (rename_dst_nr == 0 ||
-           (0 <= rename_limit && rename_limit < rename_dst_nr))
+           (0 < rename_limit && rename_limit < rename_dst_nr))
                goto cleanup; /* nothing to do */
 
        /* We really want to cull the candidates list early
@@ -307,6 +307,9 @@ void diffcore_rename(struct diff_options *options)
        if (rename_count == rename_dst_nr)
                goto cleanup;
 
+       if (minimum_score == MAX_SCORE)
+               goto cleanup;
+
        num_create = (rename_dst_nr - rename_count);
        num_src = rename_src_nr;
        mx = xmalloc(sizeof(*mx) * num_create * num_src);