summaryrefslogtreecommitdiffstats
path: root/services/repository
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2021-12-20 05:41:31 +0100
committerGitHub <noreply@github.com>2021-12-20 04:41:31 +0000
commitff2fd08228dd6323ac4a1cbd2f37f8ae15733eab (patch)
tree9079b869968d358502f64ce03caf4097556c53cd /services/repository
parent25677cdc5b11f7100ca2e4b0819e02ca62e22ab1 (diff)
downloadgitea-ff2fd08228dd6323ac4a1cbd2f37f8ae15733eab.tar.gz
gitea-ff2fd08228dd6323ac4a1cbd2f37f8ae15733eab.zip
Simplify parameter types (#18006)
Remove repeated type declarations in function definitions.
Diffstat (limited to 'services/repository')
-rw-r--r--services/repository/files/temp_repo.go6
-rw-r--r--services/repository/files/update.go2
2 files changed, 4 insertions, 4 deletions
diff --git a/services/repository/files/temp_repo.go b/services/repository/files/temp_repo.go
index 52879dd3b0..bc761e3101 100644
--- a/services/repository/files/temp_repo.go
+++ b/services/repository/files/temp_repo.go
@@ -188,12 +188,12 @@ func (t *TemporaryUploadRepository) GetLastCommitByRef(ref string) (string, erro
}
// CommitTree creates a commit from a given tree for the user with provided message
-func (t *TemporaryUploadRepository) CommitTree(author, committer *user_model.User, treeHash string, message string, signoff bool) (string, error) {
+func (t *TemporaryUploadRepository) CommitTree(author, committer *user_model.User, treeHash, message string, signoff bool) (string, error) {
return t.CommitTreeWithDate(author, committer, treeHash, message, signoff, time.Now(), time.Now())
}
// CommitTreeWithDate creates a commit from a given tree for the user with provided message
-func (t *TemporaryUploadRepository) CommitTreeWithDate(author, committer *user_model.User, treeHash string, message string, signoff bool, authorDate, committerDate time.Time) (string, error) {
+func (t *TemporaryUploadRepository) CommitTreeWithDate(author, committer *user_model.User, treeHash, message string, signoff bool, authorDate, committerDate time.Time) (string, error) {
authorSig := author.NewGitSig()
committerSig := committer.NewGitSig()
@@ -263,7 +263,7 @@ func (t *TemporaryUploadRepository) CommitTreeWithDate(author, committer *user_m
}
// Push the provided commitHash to the repository branch by the provided user
-func (t *TemporaryUploadRepository) Push(doer *user_model.User, commitHash string, branch string) error {
+func (t *TemporaryUploadRepository) Push(doer *user_model.User, commitHash, branch string) error {
// Because calls hooks we need to pass in the environment
env := models.PushingEnvironment(doer, t.repo)
if err := git.Push(t.gitRepo.Ctx, t.basePath, git.PushOptions{
diff --git a/services/repository/files/update.go b/services/repository/files/update.go
index 4bafa62cc1..0e012e16bc 100644
--- a/services/repository/files/update.go
+++ b/services/repository/files/update.go
@@ -442,7 +442,7 @@ func CreateOrUpdateRepoFile(repo *repo_model.Repository, doer *user_model.User,
}
// VerifyBranchProtection verify the branch protection for modifying the given treePath on the given branch
-func VerifyBranchProtection(repo *repo_model.Repository, doer *user_model.User, branchName string, treePath string) error {
+func VerifyBranchProtection(repo *repo_model.Repository, doer *user_model.User, branchName, treePath string) error {
protectedBranch, err := models.GetProtectedBranchBy(repo.ID, branchName)
if err != nil {
return err