History

Move db related basic functions to models/db (#17075)

* Move db related basic functions to models/db * Fix lint * Fix lint * Fix test * Fix lint * Fix lint * revert unnecessary change * Fix test * Fix wrong replace string * Use *Context * Correct committer spelling and fix wrong replaced words

Lunny Xiao committed 5 years ago

Commit a4bfef21 parent 462306e335 files · +4176 −3639Browse files

Showing the changes to services/gitdiff/gitdiff.go (1 of 335 files). Show all

Unified · Split

services/gitdiff/gitdiff.go+2−1
@@ -23,6 +23,7 @@ import ( · 22 unmodified lines
2323 "time"
2424
2525 "code.gitea.io/gitea/models"
26+ "code.gitea.io/gitea/models/db"
2627 "code.gitea.io/gitea/modules/analyze"
2728 "code.gitea.io/gitea/modules/charset"
2829 "code.gitea.io/gitea/modules/git"
@@ -1122,7 +1123,7 @@ func parseHunks(curFile *DiffFile, maxLines, maxLineCharacters int, input *bufio · 1093 unmodified lines
11221123 oid := strings.TrimPrefix(line[1:], lfs.MetaFileOidPrefix)
11231124 if len(oid) == 64 {
11241125 m := &models.LFSMetaObject{Pointer: lfs.Pointer{Oid: oid}}
1125− count, err := models.Count(m)
1126+ count, err := db.Count(m)
11261127
11271128 if err == nil && count > 0 {
11281129 curFile.IsBin = true