Skip to content

Commit a02b7ce

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

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
@@ -7,6 +7,7 @@ import (
77
"context"
88
"errors"
99
"io/fs"
10+
"os"
1011
"strings"
1112

1213
"code.gitea.io/gitea/models/git"
@@ -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)