mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user