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
action := ctx.FormString("action")
ctxUser := ctx.User
- root := filepath.Join(models.UserPath(ctxUser.LowerName))
+ root := models.UserPath(ctxUser.LowerName)
// check not a repo
has, err := models.IsRepositoryExist(ctxUser, dir)
repoNames := make([]string, 0, setting.UI.Admin.UserPagingNum)
repos := map[string]*models.Repository{}
// We're going to iterate by pagesize.
- root := filepath.Join(models.UserPath(ctxUser.Name))
+ root := models.UserPath(ctxUser.Name)
if err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
if err != nil {
if os.IsNotExist(err) {
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())