Skip to contentSkip to conversation

git-gui: fix use of undeclared variable diff_empty_count

PATCH In review Joerg Bornemann 1 participant 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-gui: fix use of undeclared variable diff_empty_count

Commit 584fa9cc introduced the global variable diff_empty_count, which is used in diff.tcl. This variable wasn't declared anywhere which resulted in an ugly error message box instead of the intended informative message.

---
 git-gui.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
git-gui.sh +1 -0
index e4a9230..46b056f 100755
@@ -1131,6 +1131,7 @@ set current_diff_path {}
 set is_3way_diff 0
 set is_conflict_diff 0
 set selected_commit_type new
+set diff_empty_count 0
 
 set nullid "0000000000000000000000000000000000000000"
 set nullid2 "0000000000000000000000000000000000000001"

--
1.6.0.2.1172.ga5ed0

#1 lore raw

This bug occurs with msysgit under mysterious circumstances. We have at
least two Windows machines where "git diff" works correctly but "git gui" is unable to get the actual diffs. Before commit 584fa9cc, git gui favoured the user with an infinite message box loop. This is what 584fa9cc should've fixed: display a nice message to the user. Instead I see the Tcl error message box, complaining about the missing variable diff_empty_count.