Skip to content
Permalink
Browse files

git-gui: fix exception when trying to stage with empty file list

If there is nothing to stage, there is nothing to stage. Let's not try
to, even if the file list contains nothing at all.

This fixes #1075

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information...
dscho committed May 23, 2017
1 parent 80a6209 commit 7cf4526635128de05c7759b0cbb678dc3a4e68f2
Showing with 3 additions and 1 deletion.
  1. +3 −1 git-gui/git-gui.sh
@@ -2516,7 +2516,9 @@ proc toggle_or_diff {mode w args} {
if {$last_clicked ne {}} {
set lno [lindex $last_clicked 1]
} else {
if {[llength $file_lists($w)] == 0} {
if {![info exists file_lists]
|| ![info exists file_lists($w)]
|| [llength $file_lists($w)] == 0} {
set last_clicked {}
return
}

0 comments on commit 7cf4526

Please sign in to comment.
You can’t perform that action at this time.