fix: Initialize start_line and del_start to prevent UnboundLocalError
This commit is contained in:
parent
b5c852e544
commit
2954f16cfd
4
gtm
4
gtm
|
|
@ -31,6 +31,10 @@ def get_diff_info(current_commit, prev_commit, filename):
|
|||
added_lines = []
|
||||
deleted_lines = []
|
||||
|
||||
# Initialize variables outside the loop to avoid UnboundLocalError
|
||||
start_line = 0
|
||||
del_start = 0
|
||||
|
||||
for line in result_additions.stdout.splitlines():
|
||||
# Parse the diff output to find line numbers of additions and deletions
|
||||
if line.startswith('@@'):
|
||||
|
|
|
|||
Loading…
Reference in New Issue