Skip to content

Commit cccdee1

Browse files
committed
manage each separator uniquely
1 parent a02b7ce commit cccdee1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

services/doctor/storage.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"context"
88
"errors"
99
"io/fs"
10-
"os"
1110
"strings"
1211

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

0 commit comments

Comments
 (0)