aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-10 16:36:50 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-10 16:36:50 -0400
commit45462662e9bdb001f1cf3d4ca0e4d679757c7642 (patch)
treeeb5f3bfe24a423601ad27121c95427719cb16984 /models
parent459223cf01d19a6956d370fad9ab41d3a32233d0 (diff)
downloadgitea-45462662e9bdb001f1cf3d4ca0e4d679757c7642.tar.gz
gitea-45462662e9bdb001f1cf3d4ca0e4d679757c7642.zip
Add flash
Diffstat (limited to 'models')
-rw-r--r--models/git.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/models/git.go b/models/git.go
index 77b7ef2d7e..68e139056a 100644
--- a/models/git.go
+++ b/models/git.go
@@ -14,6 +14,8 @@ import (
"path"
"strings"
+ "github.com/Unknwon/com"
+
"github.com/gogits/git"
"github.com/gogits/gogs/modules/base"
@@ -163,13 +165,11 @@ func getReposFiles(userName, repoName, commitId string, rpath string) ([]*RepoFi
return 0
}
- cmd := exec.Command("git", "log", "-1", "--pretty=format:%H", commitId, "--", path.Join(dirname, entry.Name))
- cmd.Dir = repopath
- out, err := cmd.Output()
+ stdout, _, err := com.ExecCmdDir(repopath, "git", "log", "-1", "--pretty=format:%H", commitId, "--", path.Join(dirname, entry.Name))
if err != nil {
return 0
}
- filecm, err := repo.GetCommit(string(out))
+ filecm, err := repo.GetCommit(string(stdout))
if err != nil {
return 0
}