Skip to content

Commit b8a6f75

Browse files
committed
Use os.PathSeparator to correctly split per OS
1 parent cddd19e commit b8a6f75

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

services/doctor/storage.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"errors"
99
"io/fs"
1010
"strings"
11+
"os"
1112

1213
"code.gitea.io/gitea/models/git"
1314
"code.gitea.io/gitea/models/packages"
@@ -121,7 +122,7 @@ func checkStorage(opts *checkStorageOptions) func(ctx context.Context, logger lo
121122
storer: storage.LFS,
122123
isOrphaned: func(path string, obj storage.Object, stat fs.FileInfo) (bool, error) {
123124
// The oid of an LFS stored object is the name but with all the path.Separators removed
124-
oid := strings.ReplaceAll(path, "/", "")
125+
oid := strings.ReplaceAll(path, string(os.PathSeparator), "")
125126
exists, err := git.ExistsLFSObject(ctx, oid)
126127
return !exists, err
127128
},

0 commit comments

Comments
 (0)