| 956 | } |
| 957 | |
| 958 | static int process_all_files(struct line_log_data **range_out, |
| 959 | struct rev_info *rev, |
| 960 | struct diff_queue_struct *queue, |
| 961 | struct line_log_data *range) |
| 962 | { |
| 963 | int i, changed = 0; |
| 964 | |
| 965 | *range_out = line_log_data_copy(range); |
| 966 | |
| 967 | for (i = 0; i < queue->nr; i++) { |
| 968 | struct diff_ranges *pairdiff = NULL; |
| 969 | struct diff_filepair *pair = queue->queue[i]; |
| 970 | if (process_diff_filepair(rev, pair, *range_out, &pairdiff)) { |
| 971 | /* |
| 972 | * Store away the diff for later output. We |
| 973 | * tuck it in the ranges we got as _input_, |
| 974 | * since that's the commit that caused the |
| 975 | * diff. |
| 976 | * |
| 977 | * NEEDSWORK not enough when we get around to |
| 978 | * doing something interesting with merges; |
| 979 | * currently each invocation on a merge parent |
| 980 | * trashes the previous one's diff. |
| 981 | * |
| 982 | * NEEDSWORK tramples over data structures not owned here |
| 983 | */ |
| 984 | struct line_log_data *rg = range; |
| 985 | changed++; |
| 986 | while (rg && strcmp(rg->path, pair->two->path)) |
| 987 | rg = rg->next; |
| 988 | assert(rg); |
| 989 | if (rg->pair) |
| 990 | diff_free_filepair(rg->pair); |
| 991 | rg->pair = diff_filepair_dup(queue->queue[i]); |
| 992 | diff_ranges_release(&rg->diff); |
| 993 | memcpy(&rg->diff, pairdiff, sizeof(struct diff_ranges)); |
| 994 | FREE_AND_NULL(pairdiff); |
| 995 | } |
| 996 | |
| 997 | if (pairdiff) { |
| 998 | diff_ranges_release(pairdiff); |
| 999 | free(pairdiff); |
| 1000 | } |
| 1001 | } |
| 1002 | |
| 1003 | return changed; |
| 1004 | } |
| 1005 | |
| 1006 | void line_log_queue_pairs(struct rev_info *rev, struct commit *commit) |
| 1007 | { |
no test coverage detected