MCPcopy Create free account
hub / github.com/git/git / update_treesame

Function update_treesame

revision.c:918–946  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

916}
917
918static unsigned update_treesame(struct rev_info *revs, struct commit *commit)
919{
920 if (commit->parents && commit->parents->next) {
921 unsigned n;
922 struct treesame_state *st;
923 struct commit_list *p;
924 unsigned relevant_parents;
925 unsigned relevant_change, irrelevant_change;
926
927 st = lookup_decoration(&revs->treesame, &commit->object);
928 if (!st)
929 die("update_treesame %s", oid_to_hex(&commit->object.oid));
930 relevant_parents = 0;
931 relevant_change = irrelevant_change = 0;
932 for (p = commit->parents, n = 0; p; n++, p = p->next) {
933 if (relevant_commit(p->item)) {
934 relevant_change |= !st->treesame[n];
935 relevant_parents++;
936 } else
937 irrelevant_change |= !st->treesame[n];
938 }
939 if (relevant_parents ? relevant_change : irrelevant_change)
940 commit->object.flags &= ~TREESAME;
941 else
942 commit->object.flags |= TREESAME;
943 }
944
945 return commit->object.flags & TREESAME;
946}
947
948static inline int limiting_can_increase_treesame(const struct rev_info *revs)
949{

Callers 2

limit_listFunction · 0.85
remove_marked_parentsFunction · 0.85

Calls 4

lookup_decorationFunction · 0.85
oid_to_hexFunction · 0.85
relevant_commitFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected