fix: Initialize start_line and del_start to prevent UnboundLocalError

This commit is contained in:
n loewen (aider) 2025-06-07 19:53:27 +01:00
parent b5c852e544
commit 2954f16cfd
1 changed files with 4 additions and 0 deletions

4
gtm
View File

@ -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('@@'):