提交 b4c813bc 编写于 作者: J Jens Lehmann 提交者: Shawn O. Pearce

git-gui: run post-checkout hook after clone

git-gui is using "git-read-tree -u" when cloning which doesn't
invoke the post-checkout hook as a plain git-clone would.
So git-gui must call the hook itself.
Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
上级 4339d510
......@@ -966,7 +966,34 @@ method _readtree_wait {fd} {
return
}
set done 1
# -- Run the post-checkout hook.
#
set fd_ph [githook_read post-checkout [string repeat 0 40] \
[git rev-parse HEAD] 1]
if {$fd_ph ne {}} {
global pch_error
set pch_error {}
fconfigure $fd_ph -blocking 0 -translation binary -eofchar {}
fileevent $fd_ph readable [cb _postcheckout_wait $fd_ph]
} else {
set done 1
}
}
method _postcheckout_wait {fd_ph} {
global pch_error
append pch_error [read $fd_ph]
fconfigure $fd_ph -blocking 1
if {[eof $fd_ph]} {
if {[catch {close $fd_ph}]} {
hook_failed_popup post-checkout $pch_error 0
}
unset pch_error
set done 1
return
}
fconfigure $fd_ph -blocking 0
}
######################################################################
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册