Skip to content

Commit a084615

Browse files
committed
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 <[email protected]>
1 parent 03b3bdb commit a084615

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

git-gui/git-gui.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2516,7 +2516,9 @@ proc toggle_or_diff {mode w args} {
25162516
if {$last_clicked ne {}} {
25172517
set lno [lindex $last_clicked 1]
25182518
} else {
2519-
if {[llength $file_lists($w)] == 0} {
2519+
if {![info exists file_lists]
2520+
|| ![info exists file_lists($w)]
2521+
|| [llength $file_lists($w)] == 0} {
25202522
set last_clicked {}
25212523
return
25222524
}

0 commit comments

Comments
 (0)