* 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
Showing the changes to services/gitdiff/gitdiff.go (1 of 335 files). Show all
Unified · Split
| @@ -23,6 +23,7 @@ import ( · 22 unmodified lines | |||
| 23 | "time" | 23 | "time" |
| 24 | 24 | ||
| 25 | "code.gitea.io/gitea/models" | 25 | "code.gitea.io/gitea/models" |
| 26 | "code.gitea.io/gitea/models/db" | ||
| 26 | "code.gitea.io/gitea/modules/analyze" | 27 | "code.gitea.io/gitea/modules/analyze" |
| 27 | "code.gitea.io/gitea/modules/charset" | 28 | "code.gitea.io/gitea/modules/charset" |
| 28 | "code.gitea.io/gitea/modules/git" | 29 | "code.gitea.io/gitea/modules/git" |
| @@ -1122,7 +1123,7 @@ func parseHunks(curFile *DiffFile, maxLines, maxLineCharacters int, input *bufio · 1093 unmodified lines | |||
| 1122 | oid := strings.TrimPrefix(line[1:], lfs.MetaFileOidPrefix) | 1123 | oid := strings.TrimPrefix(line[1:], lfs.MetaFileOidPrefix) |
| 1123 | if len(oid) == 64 { | 1124 | if len(oid) == 64 { |
| 1124 | m := &models.LFSMetaObject{Pointer: lfs.Pointer{Oid: oid}} | 1125 | m := &models.LFSMetaObject{Pointer: lfs.Pointer{Oid: oid}} |
| 1125 | count, err := models.Count(m) | 1126 | count, err := db.Count(m) |
| 1126 | 1127 | ||
| 1127 | if err == nil && count > 0 { | 1128 | if err == nil && count > 0 { |
| 1128 | curFile.IsBin = true | 1129 | curFile.IsBin = true |