X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=diffcore-rename.c;h=df41be56deab60d4d39a45920a1e62b05d0474f6;hb=48c250a121a425a1860226b6a7061aecfbab5246;hp=63ac998bfaf64da807bec0ae0bd57c391fb651fe;hpb=ef3a4fd670a4874f9b598ef96b10b89117b806e1;p=git.git diff --git a/diffcore-rename.c b/diffcore-rename.c index 63ac998bf..df41be56d 100644 --- a/diffcore-rename.c +++ b/diffcore-rename.c @@ -523,10 +523,13 @@ void diffcore_rename(struct diff_options *options) this_src.dst = i; this_src.src = j; record_if_better(m, &this_src); + /* + * Once we run estimate_similarity, + * We do not need the text anymore. + */ diff_free_filespec_blob(one); + diff_free_filespec_blob(two); } - /* We do not need the text anymore */ - diff_free_filespec_blob(two); dst_cnt++; } @@ -566,8 +569,7 @@ void diffcore_rename(struct diff_options *options) /* At this point, we have found some renames and copies and they * are recorded in rename_dst. The original list is still in *q. */ - outq.queue = NULL; - outq.nr = outq.alloc = 0; + DIFF_QUEUE_CLEAR(&outq); for (i = 0; i < q->nr; i++) { struct diff_filepair *p = q->queue[i]; struct diff_filepair *pair_to_free = NULL;