|
1 |
| -use super::{process_changes, Change, Offset, UnblamedHunk}; |
| 1 | +use super::{process_changes, Change, UnblamedHunk}; |
2 | 2 | use crate::{BlameEntry, Error, Outcome, Statistics};
|
3 | 3 | use gix_diff::blob::intern::TokenSource;
|
4 | 4 | use gix_hash::ObjectId;
|
@@ -83,11 +83,13 @@ where
|
83 | 83 | .count()
|
84 | 84 | };
|
85 | 85 |
|
86 |
| - let mut hunks_to_blame = vec![UnblamedHunk::new( |
87 |
| - 0..num_lines_in_blamed as u32, |
88 |
| - suspect, |
89 |
| - Offset::Added(0), |
90 |
| - )]; |
| 86 | + let mut hunks_to_blame = vec![{ |
| 87 | + let range_in_blamed_file = 0..num_lines_in_blamed as u32; |
| 88 | + UnblamedHunk { |
| 89 | + range_in_blamed_file: range_in_blamed_file.clone(), |
| 90 | + suspects: [(suspect, range_in_blamed_file)].into(), |
| 91 | + } |
| 92 | + }]; |
91 | 93 |
|
92 | 94 | let mut out = Vec::new();
|
93 | 95 | let mut diff_state = gix_diff::tree::State::default();
|
@@ -340,8 +342,10 @@ fn blob_changes(
|
340 | 342 |
|
341 | 343 | match (!before.is_empty(), !after.is_empty()) {
|
342 | 344 | (_, true) => {
|
343 |
| - self.hunks |
344 |
| - .push(Change::Added(after.start..after.end, before.end - before.start)); |
| 345 | + self.hunks.push(Change::AddedOrReplaced( |
| 346 | + after.start..after.end, |
| 347 | + before.end - before.start, |
| 348 | + )); |
345 | 349 | }
|
346 | 350 | (true, false) => {
|
347 | 351 | self.hunks.push(Change::Deleted(after.start, before.end - before.start));
|
|
0 commit comments