| 2914 | } |
| 2915 | |
| 2916 | int verify_commit_graph(struct commit_graph *g, int flags) |
| 2917 | { |
| 2918 | struct progress *progress = NULL; |
| 2919 | int local_error = 0; |
| 2920 | uint64_t seen = 0; |
| 2921 | |
| 2922 | if (!g) { |
| 2923 | graph_report("no commit-graph file loaded"); |
| 2924 | return 1; |
| 2925 | } |
| 2926 | |
| 2927 | if (flags & COMMIT_GRAPH_WRITE_PROGRESS) { |
| 2928 | uint64_t total = g->num_commits; |
| 2929 | if (!(flags & COMMIT_GRAPH_VERIFY_SHALLOW)) |
| 2930 | total += g->num_commits_in_base; |
| 2931 | |
| 2932 | progress = start_progress(g->odb_source->odb->repo, |
| 2933 | _("Verifying commits in commit graph"), |
| 2934 | total); |
| 2935 | } |
| 2936 | |
| 2937 | for (; g; g = g->base_graph) { |
| 2938 | local_error |= verify_one_commit_graph(g, progress, &seen); |
| 2939 | if (flags & COMMIT_GRAPH_VERIFY_SHALLOW) |
| 2940 | break; |
| 2941 | } |
| 2942 | |
| 2943 | stop_progress(&progress); |
| 2944 | |
| 2945 | return local_error; |
| 2946 | } |
| 2947 | |
| 2948 | void free_commit_graph(struct commit_graph *g) |
| 2949 | { |
no test coverage detected