Handle modified files where the case of the filename changed on case-insensitive filesystems (#6327)

* Find existing files with case insensitivity if filesystem is case insensitive
* Handle case change in folders
* Optimise to only test file system case sensitivity if the first query found nothing

This limits the overhead to new paths, and adds an extra query for new paths to windows installs
This commit is contained in:
WithoutPants
2025-12-02 12:53:37 +11:00
committed by GitHub
parent 49fd47562e
commit 4017c42fe2
18 changed files with 110 additions and 51 deletions

View File

@@ -89,7 +89,7 @@ func Test_FolderStore_Create(t *testing.T) {
assert.Equal(copy, s)
// ensure can find the folder
found, err := qb.FindByPath(ctx, path)
found, err := qb.FindByPath(ctx, path, true)
if err != nil {
t.Errorf("FolderStore.Find() error = %v", err)
}
@@ -180,7 +180,7 @@ func Test_FolderStore_Update(t *testing.T) {
return
}
s, err := qb.FindByPath(ctx, path)
s, err := qb.FindByPath(ctx, path, true)
if err != nil {
t.Errorf("FolderStore.Find() error = %v", err)
}
@@ -228,7 +228,7 @@ func Test_FolderStore_FindByPath(t *testing.T) {
for _, tt := range tests {
runWithRollbackTxn(t, tt.name, func(t *testing.T, ctx context.Context) {
got, err := qb.FindByPath(ctx, tt.path)
got, err := qb.FindByPath(ctx, tt.path, true)
if (err != nil) != tt.wantErr {
t.Errorf("FolderStore.FindByPath() error = %v, wantErr %v", err, tt.wantErr)
return