summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-10-29 20:40:57 -0400
committerUnknwon <u@gogs.io>2015-10-29 20:40:57 -0400
commit706b0f72e2e4bc91bdbed38fee609cabe9f44e43 (patch)
tree9b84a4556d0fef0c4e453b13daaab93e3b7b2591 /models
parent1f4beb530cea9c098c79d3cd4d84671265dff0e0 (diff)
downloadgitea-706b0f72e2e4bc91bdbed38fee609cabe9f44e43.tar.gz
gitea-706b0f72e2e4bc91bdbed38fee609cabe9f44e43.zip
fix issue comment mention and autofix count when start
Diffstat (limited to 'models')
-rw-r--r--models/pull.go3
-rw-r--r--models/repo.go8
2 files changed, 9 insertions, 2 deletions
diff --git a/models/pull.go b/models/pull.go
index 55f17fc27c..0300c083d7 100644
--- a/models/pull.go
+++ b/models/pull.go
@@ -160,7 +160,7 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository) (err error
}
// Clone base repo.
- tmpBasePath := path.Join("data/tmp/repos", com.ToStr(time.Now().Nanosecond())+".git")
+ tmpBasePath := path.Join(setting.AppDataPath, "tmp/repos", com.ToStr(time.Now().Nanosecond())+".git")
os.MkdirAll(path.Dir(tmpBasePath), os.ModePerm)
defer os.RemoveAll(path.Dir(tmpBasePath))
@@ -214,6 +214,7 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository) (err error
var patchConflicts = []string{
"patch does not apply",
"already exists in working directory",
+ "unrecognized input",
}
// testPatch checks if patch can be merged to base repository without conflit.
diff --git a/models/repo.go b/models/repo.go
index 9ea0abf2ae..197415c624 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -300,7 +300,7 @@ func (repo *Repository) DescriptionHtml() template.HTML {
}
func (repo *Repository) LocalCopyPath() string {
- return path.Join(setting.RepoRootPath, "local", com.ToStr(repo.ID))
+ return path.Join(setting.AppDataPath, "tmp/local", com.ToStr(repo.ID))
}
// UpdateLocalCopy makes sure the local copy of repository is up-to-date.
@@ -1488,6 +1488,12 @@ func CheckRepoStats() {
"UPDATE `user` SET num_repos=(SELECT COUNT(*) FROM `repository` WHERE owner_id=?) WHERE id=?",
"user count 'num_repos'",
},
+ // Issue.NumComments
+ {
+ "SELECT `issue`.id FROM `issue` WHERE `issue`.num_comments!=(SELECT COUNT(*) FROM `comment` WHERE issue_id=`issue`.id AND type=0)",
+ "UPDATE `issue` SET num_comments=(SELECT COUNT(*) FROM `comment` WHERE issue_id=? AND type=0) WHERE id=?",
+ "issue count 'num_comments'",
+ },
}
for i := range checkers {
repoStatsCheck(checkers[i])