@@ -367,38 +367,16 @@ fn process_change(
367
367
( true , false ) => {
368
368
// <--------> (hunk)
369
369
// <-------> (unchanged)
370
- // <----> (new hunk)
371
- // <--> (new hunk)
372
-
373
- if unchanged. start > hunk. range_in_destination . start {
374
- let line_range_in_next_destination = LineRange :: with_offset (
375
- hunk. range_in_destination . start ..unchanged. start ,
376
- * offset_in_destination,
377
- ) ;
378
-
379
- new_hunks_to_blame. push ( UnblamedHunk :: from_destination (
380
- line_range_in_next_destination. into ( ) ,
381
- hunk. offset ( ) + * offset_in_destination,
382
- ) ) ;
383
- }
384
370
385
371
let line_range_in_next_destination =
386
- LineRange :: with_offset ( unchanged . start .. hunk. range_in_destination . end , * offset_in_destination) ;
372
+ LineRange :: with_offset ( hunk. range_in_destination . clone ( ) , * offset_in_destination) ;
387
373
388
374
new_hunks_to_blame. push ( UnblamedHunk :: from_destination (
389
375
line_range_in_next_destination. into ( ) ,
390
376
hunk. offset ( ) + * offset_in_destination,
391
377
) ) ;
392
378
393
- let new_change = if unchanged. end > hunk. range_in_destination . end {
394
- let line_range = hunk. range_in_destination . end ..unchanged. end ;
395
-
396
- Some ( Change :: Unchanged ( line_range) )
397
- } else {
398
- todo ! ( ) ;
399
- } ;
400
-
401
- ( None , new_change)
379
+ ( None , Some ( Change :: Unchanged ( unchanged) ) )
402
380
}
403
381
( false , false ) => {
404
382
if unchanged. end <= hunk. range_in_destination . start {
@@ -1761,7 +1739,7 @@ fn process_change_works_enclosing_unchanged_lines() {
1761
1739
) ;
1762
1740
1763
1741
assert_eq ! ( hunk, None ) ;
1764
- assert_eq ! ( change, Some ( Change :: Unchanged ( 113 ..172 ) ) ) ;
1742
+ assert_eq ! ( change, Some ( Change :: Unchanged ( 109 ..172 ) ) ) ;
1765
1743
assert_eq ! ( lines_blamed, vec![ ] ) ;
1766
1744
assert_eq ! (
1767
1745
new_hunks_to_blame,
@@ -1819,7 +1797,7 @@ fn process_change_works_unchanged_hunk_2() {
1819
1797
) ;
1820
1798
1821
1799
assert_eq ! ( hunk, None ) ;
1822
- assert_eq ! ( change, Some ( Change :: Unchanged ( 5 ..7 ) ) ) ;
1800
+ assert_eq ! ( change, Some ( Change :: Unchanged ( 0 ..7 ) ) ) ;
1823
1801
assert_eq ! ( lines_blamed, vec![ ] ) ;
1824
1802
assert_eq ! (
1825
1803
new_hunks_to_blame,
0 commit comments