Skip to content

Commit 8b4e64d

Browse files
committed
fixup! git-gui: fix exception when trying to stage with empty file list
1 parent 26173ab commit 8b4e64d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

git-gui/git-gui.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2532,7 +2532,13 @@ proc toggle_or_diff {mode w args} {
25322532
}
25332533
}
25342534
2535-
set path [lindex $file_lists($w) [expr {$lno - 1}]]
2535+
if {![info exists file_lists]
2536+
|| ![info exists file_lists($w)]
2537+
|| [llength $file_lists($w)] < $lno - 1} {
2538+
set path {}
2539+
} else {
2540+
set path [lindex $file_lists($w) [expr {$lno - 1}]]
2541+
}
25362542
if {$path eq {}} {
25372543
set last_clicked {}
25382544
return

0 commit comments

Comments
 (0)