Skip to content

Commit

Permalink
git-gui: fix exception when trying to stage with empty file list
Browse files Browse the repository at this point in the history
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 7cf4526
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion git-gui/git-gui.sh
Expand Up @@ -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
}
Expand Down

0 comments on commit 7cf4526

Please sign in to comment.