summaryrefslogtreecommitdiffstats
path: root/models/git_diff.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-07-26 00:24:27 -0400
committerUnknwon <joe2010xtmf@163.com>2014-07-26 00:24:27 -0400
commit8dd07c0ddd99ae626a1ec8c06f75f27fed51269f (patch)
tree261d3c9911dabc58c1ac54e4e36b3dee24d2032b /models/git_diff.go
parent0a739cf9ac901f54484c34bba8322418dedb09b0 (diff)
downloadgitea-8dd07c0ddd99ae626a1ec8c06f75f27fed51269f.tar.gz
gitea-8dd07c0ddd99ae626a1ec8c06f75f27fed51269f.zip
New UI merge in progress
Diffstat (limited to 'models/git_diff.go')
-rw-r--r--models/git_diff.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/models/git_diff.go b/models/git_diff.go
index 303d61d5de..4b4d1234dd 100644
--- a/models/git_diff.go
+++ b/models/git_diff.go
@@ -13,9 +13,10 @@ import (
"strings"
"time"
+ "github.com/Unknwon/com"
+
"github.com/gogits/git"
- "github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/process"
)
@@ -118,8 +119,8 @@ func ParsePatch(pid int64, cmd *exec.Cmd, reader io.Reader) (*Diff, error) {
// Parse line number.
ranges := strings.Split(ss[len(ss)-2][1:], " ")
- leftLine, _ = base.StrTo(strings.Split(ranges[0], ",")[0][1:]).Int()
- rightLine, _ = base.StrTo(strings.Split(ranges[1], ",")[0]).Int()
+ leftLine, _ = com.StrTo(strings.Split(ranges[0], ",")[0][1:]).Int()
+ rightLine, _ = com.StrTo(strings.Split(ranges[1], ",")[0]).Int()
continue
case line[0] == '+':
curFile.Addition++
@@ -214,7 +215,7 @@ func GetDiff(repoPath, commitid string) (*Diff, error) {
select {
case <-time.After(5 * time.Minute):
if errKill := process.Kill(pid); errKill != nil {
- log.Error("git_diff.ParsePatch(Kill): %v", err)
+ log.Error(4, "git_diff.ParsePatch(Kill): %v", err)
}
<-done
// return "", ErrExecTimeout.Error(), ErrExecTimeout