@matheusbsbs / matheus-bagliano / commits / 8af52d7a83
Fork 0

git-gui: Correctly report failures from git-write-tree

If git-write-tree fails (such as if the index file is currently locked and it wants to write to it) we were not getting the error message as $tree_id was always the empty string so we shortcut through the catch and never got the output from stderr. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Oct 20, 2007 at 01:42 UTC 8af52d7a83a78c5f3a60d5bd5099a5073655339a
1 file changed +1 -1
lib/commit.tcl
+1 -1
@@ -253,7 +253,7 @@ proc commit_committree {fd_wt curHEAD msg} {
253 global repo_config
254
255 gets $fd_wt tree_id
256 - if {$tree_id eq {} || [catch {close $fd_wt} err]} {
256 + if {[catch {close $fd_wt} err]} {
257 error_popup "write-tree failed:\n\n$err"
258 ui_status {Commit failed.}
259 unlock_index