提交 3d057642 作者: Tor Arne Vestbø 提交者: Tor Arne Vestbø

Sync up request context with root context just before calling command

The context passed on from main() may change before we hit callCommand,
so setting it in Parse is a bit optimistic.
上级 00a6e595
......@@ -226,7 +226,6 @@ func (i *cmdInvocation) Parse(ctx context.Context, args []string) error {
if err != nil {
return err
}
i.req.Context().Context = ctx
repoPath, err := getRepoPath(i.req)
if err != nil {
......@@ -279,6 +278,8 @@ func callCommand(ctx context.Context, req cmds.Request, root *cmds.Command, cmd
log.Info(config.EnvDir, " ", req.Context().ConfigRoot)
var res cmds.Response
req.Context().Context = ctx
details, err := commandDetails(req.Path(), root)
if err != nil {
return nil, err
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论