Skip to content

Commit f0d4eec

Browse files
jlehmannspearce
authored andcommitted
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 <[email protected]> Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent 3eb5682 commit f0d4eec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/commit.tcl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,8 @@ A rescan will be automatically started now.
407407
#
408408
set fd_ph [githook_read post-commit]
409409
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 {}
412412
fconfigure $fd_ph -blocking 0 -translation binary -eofchar {}
413413
fileevent $fd_ph readable \
414414
[list commit_postcommit_wait $fd_ph $cmt_id]
@@ -470,7 +470,7 @@ A rescan will be automatically started now.
470470
}
471471

472472
proc commit_postcommit_wait {fd_ph cmt_id} {
473-
upvar #0 pch_error$cmt_id pch_error
473+
global pch_error
474474

475475
append pch_error [read $fd_ph]
476476
fconfigure $fd_ph -blocking 1

0 commit comments

Comments
 (0)