aboutsummaryrefslogtreecommitdiffstats
path: root/modules/repofiles/diff_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-09-06 10:20:09 +0800
committertechknowlogick <techknowlogick@gitea.io>2019-09-05 22:20:09 -0400
commitc03d75fbd51174d0e7ffdbaf9e9e253438d06cf7 (patch)
treea54e9fdfb6ff96baf7010d7fd5049a05a16644e2 /modules/repofiles/diff_test.go
parentb660a732ae283d863636ead9cc1a365ce1c0edc1 (diff)
downloadgitea-c03d75fbd51174d0e7ffdbaf9e9e253438d06cf7.tar.gz
gitea-c03d75fbd51174d0e7ffdbaf9e9e253438d06cf7.zip
Move git diff codes from models to services/gitdiff (#7889)
* move git diff codes from models to services/gitdiff * fix template * fix test * fix template
Diffstat (limited to 'modules/repofiles/diff_test.go')
-rw-r--r--modules/repofiles/diff_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/repofiles/diff_test.go b/modules/repofiles/diff_test.go
index bc7d4ebad6..de5ed1d754 100644
--- a/modules/repofiles/diff_test.go
+++ b/modules/repofiles/diff_test.go
@@ -9,6 +9,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/test"
+ "code.gitea.io/gitea/services/gitdiff"
"github.com/stretchr/testify/assert"
)
@@ -25,10 +26,10 @@ func TestGetDiffPreview(t *testing.T) {
treePath := "README.md"
content := "# repo1\n\nDescription for repo1\nthis is a new line"
- expectedDiff := &models.Diff{
+ expectedDiff := &gitdiff.Diff{
TotalAddition: 2,
TotalDeletion: 1,
- Files: []*models.DiffFile{
+ Files: []*gitdiff.DiffFile{
{
Name: "README.md",
OldName: "README.md",
@@ -42,10 +43,10 @@ func TestGetDiffPreview(t *testing.T) {
IsLFSFile: false,
IsRenamed: false,
IsSubmodule: false,
- Sections: []*models.DiffSection{
+ Sections: []*gitdiff.DiffSection{
{
Name: "",
- Lines: []*models.DiffLine{
+ Lines: []*gitdiff.DiffLine{
{
LeftIdx: 0,
RightIdx: 0,