aboutsummaryrefslogtreecommitdiffstats
path: root/models/update.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-06-27 02:15:26 +0800
committertechknowlogick <techknowlogick@gitea.io>2019-06-26 14:15:26 -0400
commitedc94c70413048107ea728ff330f32ca3de6df88 (patch)
treecf5bcc5ba8ee4b2e585dc14a6cf7440ce88bc073 /models/update.go
parent161e12e157a48f9bcd2de50c187c77444aa2a9a8 (diff)
downloadgitea-edc94c70413048107ea728ff330f32ca3de6df88.tar.gz
gitea-edc94c70413048107ea728ff330f32ca3de6df88.zip
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
Diffstat (limited to 'models/update.go')
-rw-r--r--models/update.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/models/update.go b/models/update.go
index 3eb0990d3d..411f7d5be1 100644
--- a/models/update.go
+++ b/models/update.go
@@ -7,7 +7,6 @@ package models
import (
"container/list"
"fmt"
- "os/exec"
"strings"
"time"
@@ -193,9 +192,8 @@ func pushUpdate(opts PushUpdateOptions) (repo *Repository, err error) {
repoPath := RepoPath(opts.RepoUserName, opts.RepoName)
- gitUpdate := exec.Command("git", "update-server-info")
- gitUpdate.Dir = repoPath
- if err = gitUpdate.Run(); err != nil {
+ _, err = git.NewCommand("update-server-info").RunInDir(repoPath)
+ if err != nil {
return nil, fmt.Errorf("Failed to call 'git update-server-info': %v", err)
}