diff options
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/models/repo.go b/models/repo.go index b2b6e1a26f..9f7ce8af1e 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1440,7 +1440,7 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e // Create/Remove git-daemon-export-ok for git-daemon... daemonExportFile := path.Join(repo.RepoPath(), `git-daemon-export-ok`) if repo.IsPrivate && com.IsExist(daemonExportFile) { - if err = os.Remove(daemonExportFile); err != nil { + if err = util.Remove(daemonExportFile); err != nil { log.Error("Failed to remove %s: %v", daemonExportFile, err) } } else if !repo.IsPrivate && !com.IsExist(daemonExportFile) { @@ -1708,7 +1708,7 @@ func DeleteRepository(doer *User, uid, repoID int64) error { if len(repo.Avatar) > 0 { avatarPath := repo.CustomAvatarPath() if com.IsExist(avatarPath) { - if err := os.Remove(avatarPath); err != nil { + if err := util.Remove(avatarPath); err != nil { return fmt.Errorf("Failed to remove %s: %v", avatarPath, err) } } @@ -1852,7 +1852,7 @@ func DeleteRepositoryArchives(ctx context.Context) error { return ErrCancelledf("before deleting repository archives for %s", repo.FullName()) default: } - return os.RemoveAll(filepath.Join(repo.RepoPath(), "archives")) + return util.RemoveAll(filepath.Join(repo.RepoPath(), "archives")) }) } @@ -1911,7 +1911,7 @@ func deleteOldRepositoryArchives(ctx context.Context, olderThan time.Duration, i } toDelete := filepath.Join(path, info.Name()) // This is a best-effort purge, so we do not check error codes to confirm removal. - if err = os.Remove(toDelete); err != nil { + if err = util.Remove(toDelete); err != nil { log.Trace("Unable to delete %s, but proceeding: %v", toDelete, err) } } @@ -2280,7 +2280,7 @@ func (repo *Repository) UploadAvatar(data []byte) error { } if len(oldAvatarPath) > 0 && oldAvatarPath != repo.CustomAvatarPath() { - if err := os.Remove(oldAvatarPath); err != nil { + if err := util.Remove(oldAvatarPath); err != nil { return fmt.Errorf("UploadAvatar: Failed to remove old repo avatar %s: %v", oldAvatarPath, err) } } @@ -2311,7 +2311,7 @@ func (repo *Repository) DeleteAvatar() error { } if _, err := os.Stat(avatarPath); err == nil { - if err := os.Remove(avatarPath); err != nil { + if err := util.Remove(avatarPath); err != nil { return fmt.Errorf("DeleteAvatar: Failed to remove %s: %v", avatarPath, err) } } else { |