aboutsummaryrefslogtreecommitdiffstats
path: root/services/pull
diff options
context:
space:
mode:
Diffstat (limited to 'services/pull')
-rw-r--r--services/pull/commit_status.go2
-rw-r--r--services/pull/merge.go4
-rw-r--r--services/pull/review.go1
-rw-r--r--services/pull/temp_repo.go2
-rw-r--r--services/pull/update.go2
5 files changed, 5 insertions, 6 deletions
diff --git a/services/pull/commit_status.go b/services/pull/commit_status.go
index d605f8e301..be8df0c9b1 100644
--- a/services/pull/commit_status.go
+++ b/services/pull/commit_status.go
@@ -26,7 +26,7 @@ func MergeRequiredContextsCommitStatus(commitStatuses []*models.CommitStatus, re
return structs.CommitStatusSuccess
}
- var returnedStatus = structs.CommitStatusSuccess
+ returnedStatus := structs.CommitStatusSuccess
for _, ctx := range requiredContexts {
var targetStatus structs.CommitStatusState
for _, commitStatus := range commitStatuses {
diff --git a/services/pull/merge.go b/services/pull/merge.go
index 2a67507a87..d2196b22d5 100644
--- a/services/pull/merge.go
+++ b/services/pull/merge.go
@@ -165,13 +165,13 @@ func rawMerge(ctx context.Context, pr *models.PullRequest, doer *user_model.User
}
infoPath := filepath.Join(tmpBasePath, ".git", "info")
- if err := os.MkdirAll(infoPath, 0700); err != nil {
+ if err := os.MkdirAll(infoPath, 0o700); err != nil {
log.Error("Unable to create .git/info in %s: %v", tmpBasePath, err)
return "", fmt.Errorf("Unable to create .git/info in tmpBasePath: %v", err)
}
sparseCheckoutListPath := filepath.Join(infoPath, "sparse-checkout")
- if err := os.WriteFile(sparseCheckoutListPath, []byte(sparseCheckoutList), 0600); err != nil {
+ if err := os.WriteFile(sparseCheckoutListPath, []byte(sparseCheckoutList), 0o600); err != nil {
log.Error("Unable to write .git/info/sparse-checkout file in %s: %v", tmpBasePath, err)
return "", fmt.Errorf("Unable to write .git/info/sparse-checkout file in tmpBasePath: %v", err)
}
diff --git a/services/pull/review.go b/services/pull/review.go
index 0db3168895..25eef78d97 100644
--- a/services/pull/review.go
+++ b/services/pull/review.go
@@ -24,7 +24,6 @@ import (
// CreateCodeComment creates a comment on the code line
func CreateCodeComment(ctx context.Context, doer *user_model.User, gitRepo *git.Repository, issue *models.Issue, line int64, content, treePath string, isReview bool, replyReviewID int64, latestCommitID string) (*models.Comment, error) {
-
var (
existsReview bool
err error
diff --git a/services/pull/temp_repo.go b/services/pull/temp_repo.go
index 140403172c..fa3bb2f4bb 100644
--- a/services/pull/temp_repo.go
+++ b/services/pull/temp_repo.go
@@ -70,7 +70,7 @@ func createTemporaryRepo(ctx context.Context, pr *models.PullRequest) (string, e
// Add head repo remote.
addCacheRepo := func(staging, cache string) error {
p := filepath.Join(staging, ".git", "objects", "info", "alternates")
- f, err := os.OpenFile(p, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600)
+ f, err := os.OpenFile(p, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o600)
if err != nil {
log.Error("Could not create .git/objects/info/alternates file in %s: %v", staging, err)
return err
diff --git a/services/pull/update.go b/services/pull/update.go
index 09cf1ce52e..f32dfad2ca 100644
--- a/services/pull/update.go
+++ b/services/pull/update.go
@@ -26,7 +26,7 @@ func Update(ctx context.Context, pull *models.PullRequest, doer *user_model.User
pr = pull
style = repo_model.MergeStyleRebaseUpdate
} else {
- //use merge functions but switch repo's and branch's
+ // use merge functions but switch repo's and branch's
pr = &models.PullRequest{
HeadRepoID: pull.BaseRepoID,
BaseRepoID: pull.HeadRepoID,