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