Merge branch 'jk/add-p-skip-conflicts'
[gitweb.git] / diffcore-rename.c
index d0259be412e8e262fe8661bd964145f5957315de..216a7a4bbcab189b5c3d1b7f58728b94b8d6aec8 100644 (file)
@@ -498,7 +498,7 @@ void diffcore_rename(struct diff_options *options)
        struct diff_queue_struct outq;
        struct diff_score *mx;
        int i, j, rename_count, skip_unmodified = 0;
-       int num_create, num_src, dst_cnt;
+       int num_create, dst_cnt;
        struct progress *progress = NULL;
 
        if (!minimum_score)
@@ -512,9 +512,15 @@ void diffcore_rename(struct diff_options *options)
                        else if (options->single_follow &&
                                 strcmp(options->single_follow, p->two->path))
                                continue; /* not interested */
+                       else if (!DIFF_OPT_TST(options, RENAME_EMPTY) &&
+                                is_empty_blob_sha1(p->two->sha1))
+                               continue;
                        else
                                locate_rename_dst(p->two, 1);
                }
+               else if (!DIFF_OPT_TST(options, RENAME_EMPTY) &&
+                        is_empty_blob_sha1(p->one->sha1))
+                       continue;
                else if (!DIFF_PAIR_UNMERGED(p) && !DIFF_FILE_VALID(p->two)) {
                        /*
                         * If the source is a broken "delete", and
@@ -554,7 +560,6 @@ void diffcore_rename(struct diff_options *options)
         * files still remain as options for rename/copies!)
         */
        num_create = (rename_dst_nr - rename_count);
-       num_src = rename_src_nr;
 
        /* All done? */
        if (!num_create)