summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 84f6753)
raw | patch | inline | side by side (parent: 84f6753)
author | Shawn O. Pearce <spearce@spearce.org> | |
Fri, 3 Aug 2007 02:55:22 +0000 (22:55 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Fri, 3 Aug 2007 02:55:22 +0000 (22:55 -0400) |
If there is no path currently shown in the diff viewer then we
were getting Tcl errors anytime the user right-clicked on the
diff viewer to bring up its popup menu. The bug here is caused
by trying to get the file_state for the empty string; this path
is never seen so we never have file_state for it. In such cases
we now disable the Stage Hunk For Commit option.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
were getting Tcl errors anytime the user right-clicked on the
diff viewer to bring up its popup menu. The bug here is caused
by trying to get the file_state for the empty string; this path
is never seen so we never have file_state for it. In such cases
we now disable the Stage Hunk For Commit option.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh | patch | blob | history |
diff --git a/git-gui.sh b/git-gui.sh
index 671b8873f27e68f8ed2c93efd6734f583f8b7500..2c7eb3c25cd6a20268463f3fd5d7c272b31be8f6 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
$ctxm add command -label {Options...} \
-command do_options
proc popup_diff_menu {ctxm x y X Y} {
+ global current_diff_path
set ::cursorX $x
set ::cursorY $y
if {$::ui_index eq $::current_diff_side} {
$ctxm entryconf $::ui_diff_applyhunk \
-state normal \
-label {Unstage Hunk From Commit}
- } elseif {{_O} eq [lindex $::file_states($::current_diff_path) 0]} {
+ } elseif {![info exists file_states($current_diff_path)]
+ || {_O} eq [lindex $file_states($::current_diff_path) 0]} {
$ctxm entryconf $::ui_diff_applyhunk \
-state disabled \
-label {Stage Hunk For Commit}