List the files under a path by path, not by string prefix (closes #223)
check / check (push) Successful in 12m35s
check / check (push) Successful in 12m35s
FileRepository.ListByPrefix matched with SQL LIKE: a plain string prefix that ignores ASCII case and treats _ and % as wildcards. Restoring /home/u/doc also restored doc2, DOC and doc.txt.bak, and a backup counted the files of a longer sibling path as deleted. It is now ListUnderPath, which returns the file at the path and every file whose path starts with the path plus a slash, compared exactly. A trailing slash is ignored, so "/" still lists every file. Three tests relied on string-prefix matching and now name a full path or call ListAll. ListIDsWithChunksNotInUploadedBlobs keeps its LIKE: it only adds file IDs the scan never looks up. Model: opus-5-5
This commit is contained in:
@@ -147,7 +147,7 @@ func TestOrphanedFileCleanupDebug(t *testing.T) {
|
||||
t.Logf("Files count after cleanup: %d", count)
|
||||
|
||||
// List remaining files
|
||||
files, err := repos.Files.ListByPrefix(ctx, "/")
|
||||
files, err := repos.Files.ListUnderPath(ctx, "/")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user