--- a/rust/hg-core/src/utils/files.rs Wed Aug 28 08:16:58 2019 -0400
+++ b/rust/hg-core/src/utils/files.rs Thu Aug 22 14:31:07 2019 +0200
@@ -71,6 +71,15 @@
dirs
}
+/// TODO improve handling of utf8 file names. Our overall strategy for
+/// filenames has to be revisited anyway, since Windows is UTF-16.
+pub fn normalize_case(bytes: &[u8]) -> Vec<u8> {
+ #[cfg(windows)] // NTFS compares via upper()
+ return bytes.to_ascii_uppercase();
+ #[cfg(unix)]
+ bytes.to_ascii_lowercase()
+}
+
#[cfg(test)]
mod tests {
#[test]