From 2954f16cfdec3bcddfbbbb215bfe6bc09e2e5268 Mon Sep 17 00:00:00 2001 From: "n loewen (aider)" Date: Sat, 7 Jun 2025 19:53:27 +0100 Subject: [PATCH] fix: Initialize start_line and del_start to prevent UnboundLocalError --- gtm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtm b/gtm index c44cf2d..9342d00 100755 --- a/gtm +++ b/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('@@'):