MCPcopy Index your code
hub / github.com/git/git / diff_unmodified_pair

Function diff_unmodified_pair

diff.c:6505–6535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6503}
6504
6505int 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
6537static void diff_flush_patch(struct diff_filepair *p, struct diff_options *o)
6538{

Callers 10

inexact_prefetchFunction · 0.85
diffcore_rename_extendedFunction · 0.85
intersect_pathsFunction · 0.85
pickaxe_matchFunction · 0.85
diff_flush_patchFunction · 0.85
diff_flush_statFunction · 0.85
diff_flush_checkdiffFunction · 0.85
diff_queue_is_emptyFunction · 0.85
diff_get_patch_idFunction · 0.85

Calls 1

oideqFunction · 0.85

Tested by

no test coverage detected