| 838 | } |
| 839 | |
| 840 | static void queue_diffs(struct line_log_data *range, |
| 841 | struct diff_options *opt, |
| 842 | struct diff_queue_struct *queue, |
| 843 | struct commit *commit, struct commit *parent) |
| 844 | { |
| 845 | struct object_id *tree_oid, *parent_tree_oid; |
| 846 | |
| 847 | assert(commit); |
| 848 | |
| 849 | tree_oid = get_commit_tree_oid(commit); |
| 850 | parent_tree_oid = parent ? get_commit_tree_oid(parent) : NULL; |
| 851 | |
| 852 | if (opt->detect_rename && |
| 853 | !same_paths_in_pathspec_and_range(&opt->pathspec, range)) { |
| 854 | clear_pathspec(&opt->pathspec); |
| 855 | parse_pathspec_from_ranges(&opt->pathspec, range); |
| 856 | } |
| 857 | diff_queue_clear(&diff_queued_diff); |
| 858 | diff_tree_oid(parent_tree_oid, tree_oid, "", opt); |
| 859 | if (opt->detect_rename && diff_might_be_rename()) { |
| 860 | struct diff_options rename_opts; |
| 861 | |
| 862 | /* |
| 863 | * Build a private diff_options for rename detection so |
| 864 | * that any user-specified options on the original opts |
| 865 | * (e.g. pickaxe) cannot discard diff pairs needed for |
| 866 | * rename tracking. Similar to blame's find_rename(). |
| 867 | */ |
| 868 | repo_diff_setup(opt->repo, &rename_opts); |
| 869 | rename_opts.flags.recursive = 1; |
| 870 | rename_opts.detect_rename = opt->detect_rename; |
| 871 | rename_opts.rename_score = opt->rename_score; |
| 872 | rename_opts.output_format = DIFF_FORMAT_NO_OUTPUT; |
| 873 | diff_setup_done(&rename_opts); |
| 874 | |
| 875 | /* must look at the full tree diff to detect renames */ |
| 876 | diff_queue_clear(&diff_queued_diff); |
| 877 | diff_tree_oid(parent_tree_oid, tree_oid, "", &rename_opts); |
| 878 | |
| 879 | filter_diffs_for_paths(range, 1); |
| 880 | diffcore_std(&rename_opts); |
| 881 | filter_diffs_for_paths(range, 0); |
| 882 | diff_free(&rename_opts); |
| 883 | } |
| 884 | move_diff_queue(queue, &diff_queued_diff); |
| 885 | } |
| 886 | |
| 887 | /* |
| 888 | * Unlike most other functions, this destructively operates on |
no test coverage detected