Skip to content
9 changes: 8 additions & 1 deletion modules/git/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ func (c *Command) Run(opts *RunOpts) error {
log.Debug("git.Command.RunDir(%s): %s", opts.Dir, c)
}

startTime := time.Now()
desc := c.desc
if desc == "" {
if opts.Dir == "" {
Expand Down Expand Up @@ -327,7 +328,13 @@ func (c *Command) Run(opts *RunOpts) error {
}
}

if err := cmd.Wait(); err != nil && ctx.Err() != context.DeadlineExceeded {
err := cmd.Wait()
elapsed := time.Since(startTime)
if elapsed > time.Second {
log.Debug("slow it.Command.Run: %s (%s)", c, elapsed)
}

if err != nil && ctx.Err() != context.DeadlineExceeded {
return err
}

Expand Down