| 6503 | } |
| 6504 | |
| 6505 | int diff_unmodified_pair(struct diff_filepair *p) |
| 6506 | { |
| 6507 | /* This function is written stricter than necessary to support |
| 6508 | * the currently implemented transformers, but the idea is to |
| 6509 | * let transformers to produce diff_filepairs any way they want, |
| 6510 | * and filter and clean them up here before producing the output. |
| 6511 | */ |
| 6512 | struct diff_filespec *one = p->one, *two = p->two; |
| 6513 | |
| 6514 | if (DIFF_PAIR_UNMERGED(p)) |
| 6515 | return 0; /* unmerged is interesting */ |
| 6516 | |
| 6517 | /* deletion, addition, mode or type change |
| 6518 | * and rename are all interesting. |
| 6519 | */ |
| 6520 | if (DIFF_FILE_VALID(one) != DIFF_FILE_VALID(two) || |
| 6521 | DIFF_PAIR_MODE_CHANGED(p) || |
| 6522 | strcmp(one->path, two->path)) |
| 6523 | return 0; |
| 6524 | |
| 6525 | /* both are valid and point at the same path. that is, we are |
| 6526 | * dealing with a change. |
| 6527 | */ |
| 6528 | if (one->oid_valid && two->oid_valid && |
| 6529 | oideq(&one->oid, &two->oid) && |
| 6530 | !one->dirty_submodule && !two->dirty_submodule) |
| 6531 | return 1; /* no change */ |
| 6532 | if (!one->oid_valid && !two->oid_valid) |
| 6533 | return 1; /* both look at the same file on the filesystem. */ |
| 6534 | return 0; |
| 6535 | } |
| 6536 | |
| 6537 | static void diff_flush_patch(struct diff_filepair *p, struct diff_options *o) |
| 6538 | { |
no test coverage detected