summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2021-11-15 06:02:53 +0000
committerGitHub <noreply@github.com>2021-11-15 14:02:53 +0800
commit253d9e415813e90543cca8d94112c9e4238d39a4 (patch)
treec60e0dc33e437dfbd4855b9c0b5939351451720f /services
parent562785ef4ea8ea4b24da726a4fbf515358ee7084 (diff)
downloadgitea-253d9e415813e90543cca8d94112c9e4238d39a4.tar.gz
gitea-253d9e415813e90543cca8d94112c9e4238d39a4.zip
Remove unnecassary calls to `filepath.Join` (#17608)
- Partialy resolvess #17596 - Resolves `badCall` errors from go-critic `badCall: suspicious Join on 1 argument` - When only 1 argument is passed into `filepath.Join`, it won't do anything special other than `filepath.Clean(...)` will be applied over it. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'services')
-rw-r--r--services/pull/merge.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/pull/merge.go b/services/pull/merge.go
index f59931e1bf..e4ed4e38bd 100644
--- a/services/pull/merge.go
+++ b/services/pull/merge.go
@@ -275,8 +275,8 @@ func rawMerge(pr *models.PullRequest, doer *models.User, mergeStyle models.Merge
filepath.Join(tmpBasePath, ".git", "rebase-merge", "stopped-sha"), // Git >= 2.26
}
for _, failingCommitPath := range failingCommitPaths {
- if _, statErr := os.Stat(filepath.Join(failingCommitPath)); statErr == nil {
- commitShaBytes, readErr := os.ReadFile(filepath.Join(failingCommitPath))
+ if _, statErr := os.Stat(failingCommitPath); statErr == nil {
+ commitShaBytes, readErr := os.ReadFile(failingCommitPath)
if readErr != nil {
// Abandon this attempt to handle the error
log.Error("git rebase staging on to base [%s:%s -> %s:%s]: %v\n%s\n%s", pr.HeadRepo.FullName(), pr.HeadBranch, pr.BaseRepo.FullName(), pr.BaseBranch, err, outbuf.String(), errbuf.String())