fix(lfs): validate OID before building filesystem object path (#39762)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Basavaraj S mandwxiaoguang authored and GitHub committed 2026-10-13 23:29:29 +00:00
1 parent 0eb57b927a
commit bac747518a
5 files changed
+52 -20

No files matched your search

+1
View File
@@ -119,6 +119,7 @@ func checkStorage(opts *checkStorageOptions) func(ctx context.Context, logger lo
&commonStorageCheckOptions{
storer: storage.LFS,
isOrphaned: func(path string, obj storage.Object, stat fs.FileInfo) (bool, error) {
// HINT: LFS-INTERNAL-PATH-PATTERN
// The oid of an LFS stored object is the name but with all the path.Separators removed
oid := strings.ReplaceAll(strings.ReplaceAll(path, "\\", ""), "/", "")
exists, err := git.ExistsLFSObject(ctx, oid)