diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-09-06 10:20:09 +0800 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-09-05 22:20:09 -0400 |
commit | c03d75fbd51174d0e7ffdbaf9e9e253438d06cf7 (patch) | |
tree | a54e9fdfb6ff96baf7010d7fd5049a05a16644e2 /modules/repofiles/diff_test.go | |
parent | b660a732ae283d863636ead9cc1a365ce1c0edc1 (diff) | |
download | gitea-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.go | 9 |
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, |