mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-12 10:55:17 +00:00
protections
This commit is contained in:
parent
2bc25b7435
commit
992f51a019
1 changed files with 3 additions and 3 deletions
|
|
@ -45,11 +45,11 @@ def extend_patch(original_file_str, patch_str, num_lines) -> str:
|
||||||
if res[i] is None:
|
if res[i] is None:
|
||||||
res[i] = 0
|
res[i] = 0
|
||||||
try:
|
try:
|
||||||
start1, size1, start2, size2 = map(int, match.groups()[:4])
|
start1, size1, start2, size2 = map(int, res[:4])
|
||||||
except: # '@@ -0,0 +1 @@' case
|
except: # '@@ -0,0 +1 @@' case
|
||||||
start1, size1, size2 = map(int, match.groups()[:3])
|
start1, size1, size2 = map(int, res[:3])
|
||||||
start2 = 0
|
start2 = 0
|
||||||
section_header = match.groups()[4]
|
section_header = res[4]
|
||||||
extended_start1 = max(1, start1 - num_lines)
|
extended_start1 = max(1, start1 - num_lines)
|
||||||
extended_size1 = size1 + (start1 - extended_start1) + num_lines
|
extended_size1 = size1 + (start1 - extended_start1) + num_lines
|
||||||
extended_start2 = max(1, start2 - num_lines)
|
extended_start2 = max(1, start2 - num_lines)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue