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

Function rev_same_tree_as_empty

revision.c:825–848  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

823}
824
825static int rev_same_tree_as_empty(struct rev_info *revs, struct commit *commit,
826 int nth_parent)
827{
828 struct tree *t1 = repo_get_commit_tree(the_repository, commit);
829 int bloom_ret = -1;
830
831 if (!t1)
832 return 0;
833
834 if (!nth_parent && revs->bloom_keyvecs_nr) {
835 bloom_ret = check_maybe_different_in_bloom_filter(revs, commit);
836 if (!bloom_ret)
837 return 1;
838 }
839
840 tree_difference = REV_TREE_SAME;
841 revs->pruning.flags.has_changes = 0;
842 diff_tree_oid(NULL, &t1->object.oid, "", &revs->pruning);
843
844 if (bloom_ret == 1 && tree_difference == REV_TREE_SAME)
845 count_bloom_filter_false_positive++;
846
847 return tree_difference == REV_TREE_SAME;
848}
849
850struct treesame_state {
851 unsigned int nparents;

Callers 2

compact_treesameFunction · 0.85
try_to_simplify_commitFunction · 0.85

Calls 3

repo_get_commit_treeFunction · 0.85
diff_tree_oidFunction · 0.85

Tested by

no test coverage detected