@matheusbsbs / matheus-bagliano / commits / f0d4eec99f
Fork 0

git-gui: When calling post-commit hook wrong variable was cleared.

Before calling the post-commit hook, the variable "pc_err" is cleared while later only "pch_error" is used. "pch_error$cmt_id" only appeared in "upvar"-Statements (which were changed to "global") and was removed. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Jens Lehmann committed Mar 30, 2009 at 20:35 UTC f0d4eec99f2367bad77ec46680d7b07d4472d230
1 file changed +3 -3
lib/commit.tcl
+3 -3
@@ -407,8 +407,8 @@ A rescan will be automatically started now.
407 #
408 set fd_ph [githook_read post-commit]
409 if {$fd_ph ne {}} {
410 - upvar #0 pch_error$cmt_id pc_err
411 - set pc_err {}
410 + global pch_error
411 + set pch_error {}
412 fconfigure $fd_ph -blocking 0 -translation binary -eofchar {}
413 fileevent $fd_ph readable \
414 [list commit_postcommit_wait $fd_ph $cmt_id]
@@ -470,7 +470,7 @@ A rescan will be automatically started now.
470 }
471
472 proc commit_postcommit_wait {fd_ph cmt_id} {
473 - upvar #0 pch_error$cmt_id pch_error
473 + global pch_error
474
475 append pch_error [read $fd_ph]
476 fconfigure $fd_ph -blocking 1