summaryrefslogtreecommitdiffstats
path: root/integrations/pull_update_test.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2022-01-20 18:46:10 +0100
committerGitHub <noreply@github.com>2022-01-20 18:46:10 +0100
commit54e9ee37a7a301dbe74d46fd3c87712e6120e9bf (patch)
tree1be12fb072625c1b896b9d72f7912b018aad502b /integrations/pull_update_test.go
parent1d98d205f5825f40110e6628b61a97c91ac7f72d (diff)
downloadgitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.tar.gz
gitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.zip
format with gofumpt (#18184)
* gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
Diffstat (limited to 'integrations/pull_update_test.go')
-rw-r--r--integrations/pull_update_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/integrations/pull_update_test.go b/integrations/pull_update_test.go
index b80b85fbeb..dc2803aca0 100644
--- a/integrations/pull_update_test.go
+++ b/integrations/pull_update_test.go
@@ -23,12 +23,12 @@ import (
func TestAPIPullUpdate(t *testing.T) {
onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) {
- //Create PR to test
+ // Create PR to test
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}).(*user_model.User)
org26 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 26}).(*user_model.User)
pr := createOutdatedPR(t, user, org26)
- //Test GetDiverging
+ // Test GetDiverging
diffCount, err := pull_service.GetDiverging(git.DefaultContext, pr)
assert.NoError(t, err)
assert.EqualValues(t, 1, diffCount.Behind)
@@ -41,7 +41,7 @@ func TestAPIPullUpdate(t *testing.T) {
req := NewRequestf(t, "POST", "/api/v1/repos/%s/%s/pulls/%d/update?token="+token, pr.BaseRepo.OwnerName, pr.BaseRepo.Name, pr.Issue.Index)
session.MakeRequest(t, req, http.StatusOK)
- //Test GetDiverging after update
+ // Test GetDiverging after update
diffCount, err = pull_service.GetDiverging(git.DefaultContext, pr)
assert.NoError(t, err)
assert.EqualValues(t, 0, diffCount.Behind)
@@ -51,12 +51,12 @@ func TestAPIPullUpdate(t *testing.T) {
func TestAPIPullUpdateByRebase(t *testing.T) {
onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) {
- //Create PR to test
+ // Create PR to test
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}).(*user_model.User)
org26 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 26}).(*user_model.User)
pr := createOutdatedPR(t, user, org26)
- //Test GetDiverging
+ // Test GetDiverging
diffCount, err := pull_service.GetDiverging(git.DefaultContext, pr)
assert.NoError(t, err)
assert.EqualValues(t, 1, diffCount.Behind)
@@ -69,7 +69,7 @@ func TestAPIPullUpdateByRebase(t *testing.T) {
req := NewRequestf(t, "POST", "/api/v1/repos/%s/%s/pulls/%d/update?style=rebase&token="+token, pr.BaseRepo.OwnerName, pr.BaseRepo.Name, pr.Issue.Index)
session.MakeRequest(t, req, http.StatusOK)
- //Test GetDiverging after update
+ // Test GetDiverging after update
diffCount, err = pull_service.GetDiverging(git.DefaultContext, pr)
assert.NoError(t, err)
assert.EqualValues(t, 0, diffCount.Behind)
@@ -98,7 +98,7 @@ func createOutdatedPR(t *testing.T, actor, forkOrg *user_model.User) *models.Pul
assert.NoError(t, err)
assert.NotEmpty(t, headRepo)
- //create a commit on base Repo
+ // create a commit on base Repo
_, err = files_service.CreateOrUpdateRepoFile(git.DefaultContext, baseRepo, actor, &files_service.UpdateRepoFileOptions{
TreePath: "File_A",
Message: "Add File A",
@@ -121,7 +121,7 @@ func createOutdatedPR(t *testing.T, actor, forkOrg *user_model.User) *models.Pul
})
assert.NoError(t, err)
- //create a commit on head Repo
+ // create a commit on head Repo
_, err = files_service.CreateOrUpdateRepoFile(git.DefaultContext, headRepo, actor, &files_service.UpdateRepoFileOptions{
TreePath: "File_B",
Message: "Add File on PR branch",
@@ -144,7 +144,7 @@ func createOutdatedPR(t *testing.T, actor, forkOrg *user_model.User) *models.Pul
})
assert.NoError(t, err)
- //create Pull
+ // create Pull
pullIssue := &models.Issue{
RepoID: baseRepo.ID,
Title: "Test Pull -to-update-",