summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 444f92d)
raw | patch | inline | side by side (parent: 444f92d)
author | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 21 Nov 2006 02:59:19 +0000 (21:59 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 21 Nov 2006 05:22:34 +0000 (00:22 -0500) |
Because we don't automatically restart in amend mode when we quit while
in amend mode the commit message buffer shouldn't be saved to GITGUI_MSG
as it would be misleading when the user restarts the application.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
in amend mode the commit message buffer shouldn't be saved to GITGUI_MSG
as it would be misleading when the user restarts the application.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui | patch | blob | history |
index 2aa82781e95fa742f4b6526f8e251d0e2f2f9ee8..d0176aca7792ee60d12fabedecaf1d6080c5869d 100755 (executable)
--- a/git-gui
+++ b/git-gui
} elseif {[load_message MERGE_MSG]} {
} elseif {[load_message SQUASH_MSG]} {
}
- $ui_comm edit modified false
$ui_comm edit reset
+ $ui_comm edit modified false
}
if {$repo_config(gui.trustmtime) eq {true}} {
$ui_comm delete 0.0 end
$ui_comm insert end $msg
- $ui_comm edit modified false
$ui_comm edit reset
+ $ui_comm edit modified false
rescan {set ui_status_value {Ready.}}
}
set commit_type normal
$ui_comm delete 0.0 end
- $ui_comm edit modified false
$ui_comm edit reset
+ $ui_comm edit modified false
rescan {set ui_status_value {Ready.}}
}
}
$ui_comm delete 0.0 end
- $ui_comm edit modified false
$ui_comm edit reset
+ $ui_comm edit modified false
if {$single_commit} do_quit
set is_quitting 0
proc do_quit {} {
- global gitdir ui_comm is_quitting repo_config
+ global gitdir ui_comm is_quitting repo_config commit_type
if {$is_quitting} return
set is_quitting 1
#
set save [file join $gitdir GITGUI_MSG]
set msg [string trim [$ui_comm get 0.0 end]]
- if {[$ui_comm edit modified] && $msg ne {}} {
+ if {![string match amend* $commit_type]
+ && [$ui_comm edit modified]
+ && $msg ne {}} {
catch {
set fd [open $save w]
puts $fd [string trim [$ui_comm get 0.0 end]]
close $fd
}
- } elseif {$msg eq {} && [file exists $save]} {
- file delete $save
+ } else {
+ catch {file delete $save}
}
# -- Stash our current window geometry into this repository.