Skip to content

Commit 84d18d3

Browse files
Fix lint
1 parent 2c7ceed commit 84d18d3

File tree

5 files changed

+4
-8
lines changed

5 files changed

+4
-8
lines changed

services/repository/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ func CreateRepositoryDirectly(ctx context.Context, doer, owner *user_model.User,
259259
defer func() {
260260
if err != nil {
261261
// we can not use the ctx because it maybe canceled or timeout
262-
cleanupRepository(doer, repo.ID)
262+
cleanupRepository(repo.ID)
263263
}
264264
}()
265265

@@ -454,7 +454,7 @@ func createRepositoryInDB(ctx context.Context, doer, u *user_model.User, repo *r
454454
return nil
455455
}
456456

457-
func cleanupRepository(doer *user_model.User, repoID int64) {
457+
func cleanupRepository(repoID int64) {
458458
if errDelete := DeleteRepositoryDirectly(db.DefaultContext, repoID); errDelete != nil {
459459
log.Error("cleanupRepository failed: %v", errDelete)
460460
// add system notice

services/repository/fork.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func ForkRepository(ctx context.Context, doer, owner *user_model.User, opts Fork
124124
defer func() {
125125
if err != nil {
126126
// we can not use the ctx because it maybe canceled or timeout
127-
cleanupRepository(doer, repo.ID)
127+
cleanupRepository(repo.ID)
128128
}
129129
}()
130130

services/repository/template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func GenerateRepository(ctx context.Context, doer, owner *user_model.User, templ
102102
defer func() {
103103
if err != nil {
104104
// we can not use the ctx because it maybe canceled or timeout
105-
cleanupRepository(doer, generateRepo.ID)
105+
cleanupRepository(generateRepo.ID)
106106
}
107107
}()
108108

tests/integration/ephemeral_actions_runner_deletion_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ func testEphemeralActionsRunnerDeletionByRepository(t *testing.T) {
5050
task := unittest.AssertExistsAndLoadBean(t, &actions_model.ActionTask{ID: 52})
5151
assert.Equal(t, actions_model.StatusRunning, task.Status)
5252

53-
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
54-
5553
err = repo_service.DeleteRepositoryDirectly(t.Context(), task.RepoID, true)
5654
assert.NoError(t, err)
5755

tests/integration/pull_compare_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
issues_model "code.gitea.io/gitea/models/issues"
1414
repo_model "code.gitea.io/gitea/models/repo"
1515
"code.gitea.io/gitea/models/unittest"
16-
user_model "code.gitea.io/gitea/models/user"
1716
"code.gitea.io/gitea/modules/test"
1817
repo_service "code.gitea.io/gitea/services/repository"
1918
"code.gitea.io/gitea/tests"
@@ -76,7 +75,6 @@ func TestPullCompare(t *testing.T) {
7675
assert.Positive(t, editButtonCount, "Expected to find a button to edit a file in the PR diff view but there were none")
7776

7877
repoForked := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{OwnerName: "user1", Name: "repo1"})
79-
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
8078

8179
// delete the head repository and revisit the PR diff view
8280
err := repo_service.DeleteRepositoryDirectly(db.DefaultContext, repoForked.ID)

0 commit comments

Comments
 (0)