| 655 | } |
| 656 | |
| 657 | int do_diff_cache(const struct object_id *tree_oid, struct diff_options *opt) |
| 658 | { |
| 659 | struct rev_info revs; |
| 660 | |
| 661 | repo_init_revisions(opt->repo, &revs, NULL); |
| 662 | copy_pathspec(&revs.prune_data, &opt->pathspec); |
| 663 | diff_free(&revs.diffopt); |
| 664 | revs.diffopt = *opt; |
| 665 | revs.diffopt.no_free = 1; |
| 666 | |
| 667 | if (diff_cache(&revs, tree_oid, NULL, 1)) |
| 668 | exit(128); |
| 669 | |
| 670 | release_revisions(&revs); |
| 671 | return 0; |
| 672 | } |
| 673 | |
| 674 | int index_differs_from(struct repository *r, |
| 675 | const char *def, const struct diff_flags *flags, |
no test coverage detected