| 775 | } |
| 776 | |
| 777 | static int rev_compare_tree(struct rev_info *revs, |
| 778 | struct commit *parent, struct commit *commit, int nth_parent) |
| 779 | { |
| 780 | struct tree *t1 = repo_get_commit_tree(the_repository, parent); |
| 781 | struct tree *t2 = repo_get_commit_tree(the_repository, commit); |
| 782 | int bloom_ret = 1; |
| 783 | |
| 784 | if (!t1) |
| 785 | return REV_TREE_NEW; |
| 786 | if (!t2) |
| 787 | return REV_TREE_OLD; |
| 788 | |
| 789 | if (revs->simplify_by_decoration) { |
| 790 | /* |
| 791 | * If we are simplifying by decoration, then the commit |
| 792 | * is worth showing if it has a tag pointing at it. |
| 793 | */ |
| 794 | if (get_name_decoration(&commit->object)) |
| 795 | return REV_TREE_DIFFERENT; |
| 796 | /* |
| 797 | * A commit that is not pointed by a tag is uninteresting |
| 798 | * if we are not limited by path. This means that you will |
| 799 | * see the usual "commits that touch the paths" plus any |
| 800 | * tagged commit by specifying both --simplify-by-decoration |
| 801 | * and pathspec. |
| 802 | */ |
| 803 | if (!revs->prune_data.nr) |
| 804 | return REV_TREE_SAME; |
| 805 | } |
| 806 | |
| 807 | if (revs->bloom_keyvecs_nr && !nth_parent) { |
| 808 | bloom_ret = check_maybe_different_in_bloom_filter(revs, commit); |
| 809 | |
| 810 | if (bloom_ret == 0) |
| 811 | return REV_TREE_SAME; |
| 812 | } |
| 813 | |
| 814 | tree_difference = REV_TREE_SAME; |
| 815 | revs->pruning.flags.has_changes = 0; |
| 816 | diff_tree_oid(&t1->object.oid, &t2->object.oid, "", &revs->pruning); |
| 817 | |
| 818 | if (!nth_parent) |
| 819 | if (bloom_ret == 1 && tree_difference == REV_TREE_SAME) |
| 820 | count_bloom_filter_false_positive++; |
| 821 | |
| 822 | return tree_difference; |
| 823 | } |
| 824 | |
| 825 | static int rev_same_tree_as_empty(struct rev_info *revs, struct commit *commit, |
| 826 | int nth_parent) |
no test coverage detected