summaryrefslogtreecommitdiffstats
path: root/modules/repository/adopt.go
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 /modules/repository/adopt.go
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 'modules/repository/adopt.go')
-rw-r--r--modules/repository/adopt.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/repository/adopt.go b/modules/repository/adopt.go
index 21477ab7d7..3d895ac484 100644
--- a/modules/repository/adopt.go
+++ b/modules/repository/adopt.go
@@ -154,7 +154,7 @@ func ListUnadoptedRepositories(query string, opts *db.ListOptions) ([]string, in
count := 0
// We're going to iterate by pagesize.
- root := filepath.Join(setting.RepoRootPath)
+ root := filepath.Clean(setting.RepoRootPath)
if err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err