From edc94c70413048107ea728ff330f32ca3de6df88 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 27 Jun 2019 02:15:26 +0800 Subject: Monitor all git commands; move blame to git package and replace git as a variable (#6864) * monitor all git commands; move blame to git package and replace git as a variable * use git command but not other commands * fix build * move exec.Command to git.NewCommand * fix fmt * remove unrelated changes * remove unrelated changes * refactor IsEmpty and add tests * fix tests * fix tests * fix tests * fix tests * remove gitLogger * fix fmt * fix isEmpty * fix lint * fix tests --- modules/git/command.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/git/command.go') diff --git a/modules/git/command.go b/modules/git/command.go index d6221ce268..347dcfe39f 100644 --- a/modules/git/command.go +++ b/modules/git/command.go @@ -12,6 +12,8 @@ import ( "os/exec" "strings" "time" + + "code.gitea.io/gitea/modules/process" ) var ( @@ -84,6 +86,9 @@ func (c *Command) RunInDirTimeoutEnvFullPipeline(env []string, timeout time.Dura return err } + pid := process.GetManager().Add(fmt.Sprintf("%s %s %s [repo_path: %s]", GitExecutable, c.name, strings.Join(c.args, " "), dir), cmd) + defer process.GetManager().Remove(pid) + if err := cmd.Wait(); err != nil { return err } -- cgit v1.2.3