This repository was archived by the owner on Jun 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
graphql_api/types/impacted_file Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -98,9 +98,8 @@ def resolve_segments(
9898 # segments with no diff changes and at least 1 unintended change
9999 segments = [segment for segment in segments if segment .has_unintended_changes ]
100100 elif filters .get ("has_unintended_changes" ) is False :
101- # segments with at least 1 diff change
102-
103- segments = [segment for segment in segments if (segment .has_diff_changes and segment .has_unintended_changes )]
101+ file_comparison .reset_lines_without_unintended_changes ()
102+ segments = file_comparison .segments
104103
105104 return SegmentComparisons (results = segments )
106105
Original file line number Diff line number Diff line change @@ -481,6 +481,15 @@ def has_unintended_changes(self):
481481 return True
482482 return False
483483
484+ def reset_lines_without_unintended_changes (self ):
485+ if self .lines is None :
486+ return
487+ filtered = [l for l in self .lines if not l .get ('unintended_change' , False )]
488+ if hasattr (self , '_calculated_changes_and_lines' ):
489+ summary , _ = self ._calculated_changes_and_lines
490+ self ._calculated_changes_and_lines = (summary , filtered )
491+ self .lines = filtered
492+
484493
485494class FileComparison :
486495 def __init__ (
You can’t perform that action at this time.
0 commit comments