for (j = 0; j < q->nr; j++) {
pp = q->queue[j];
if (!strcmp(p->one->path, pp->one->path) &&
- pp->score) {
+ DIFF_PAIR_RENAME(pp)) {
/* rename/copy are always valid
* so we do not say DIFF_FILE_VALID()
* on pp->one and pp->two.
* whose both sides are valid and of the same type, i.e.
* either in-place edit or rename/copy edit.
*/
- else if (p->score) {
+ else if (DIFF_PAIR_RENAME(p)) {
if (p->source_stays) {
p->status = 'C';
continue;
pp = q->queue[j];
if (strcmp(pp->one->path, p->one->path))
continue; /* not us */
- if (!pp->score)
+ if (!DIFF_PAIR_RENAME(pp))
continue; /* not a rename/copy */
/* pp is a rename/copy from the same source */
p->status = 'C';
q->nr = q->alloc = 0;
}
+void diffcore_std(const char **paths,
+ int detect_rename, int rename_score,
+ const char *pickaxe, int pickaxe_opts)
+{
+ if (paths && paths[0])
+ diffcore_pathspec(paths);
+ if (detect_rename)
+ diffcore_rename(detect_rename, rename_score);
+ if (pickaxe)
+ diffcore_pickaxe(pickaxe, pickaxe_opts);
+}
+
void diff_addremove(int addremove, unsigned mode,
const unsigned char *sha1,
const char *base, const char *path)