mirror of
https://github.com/restic/restic.git
synced 2025-12-12 03:11:56 +00:00
restore: use case insensitive file name comparison on windows
This commit is contained in:
13
internal/restorer/restorer_windows.go
Normal file
13
internal/restorer/restorer_windows.go
Normal file
@@ -0,0 +1,13 @@
|
||||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package restorer
|
||||
|
||||
import "strings"
|
||||
|
||||
// toComparableFilename returns a filename suitable for equality checks. On Windows, it returns the
|
||||
// uppercase version of the string. On all other systems, it returns the unmodified filename.
|
||||
func toComparableFilename(path string) string {
|
||||
// apparently NTFS internally uppercases filenames for comparision
|
||||
return strings.ToUpper(path)
|
||||
}
|
||||
Reference in New Issue
Block a user