Repository: TabbyML/tabby
File: crates/tabby-common/src/config.rs (Rust)

Code before:
                PathBuf::from("/home/user/project"),
            ),
            // Standard Windows-style file URL (forward slashes)
            (
                "file:///C:/Users/test/project",
                PathBuf::from(r"C:\Users\test\project"),
            ),
            // Lowercase drive letter (still valid on Windows)
            (
                "file:///c:/Users/test/project",
                PathBuf::from(r"C:\Users\test\project"),
            ),
            // File URL with trailing slash
            (
                "file:///C:/Users/test/project/",
                PathBuf::from(r"C:\Users\test\project"),
            ),
            // URL with encoded characters (e.g., spaces)
            (
                "file:///C:/Users/test/My%20Project",
                PathBuf::from(r"C:\Users\test\My Project"),
            ),
            // File URL pointing to a .git repo
            (
                "file:///C:/Users/test/project.git",
                PathBuf::from(r"C:\Users\test\project.git"),
            ),
            // Non-standard: multiple slashes (still accepted by url crate)
            (
                "file:////C:/Users/test/project",
                PathBuf::from(r"C:\Users\test\project"),
            ),
            // Non-standard: missing third slash (valid but discouraged)
            (
                "file://C:/Users/test/project",
                PathBuf::from(r"C:\Users\test\project"),
            ),
        ];

        for (input, expected_suffix) in test_cases {
            // Skip incompatible test cases based on platform
            if is_windows && expected_suffix.starts_with("/") {
                continue; // Skip Unix paths on Windows
            }
            if !is_windows && expected_suffix.to_string_lossy().contains(':') {
                continue; // Skip Windows paths on Unix
            }

            let result = RepositoryConfig::resolve_dir(input);

            // Only check that the resulting path ends with the expected suffix

Review comment (suggestion):
```rust
                "file://C:\Users\test\project",
                PathBuf::from(r"C:\Users\test\project"),
```

Code after:
            // Trailing slash
            (
                "file:///C:/Users/test/project/",
                PathBuf::from(r"C:\Users\test\project"),
            ),
            // Encoded characters
            (
                "file:///C:/Users/test/My%20Project",
                PathBuf::from(r"C:\Users\test\My Project"),
            ),
            // .git repo
            (
                "file:///C:/Users/test/project.git",
                PathBuf::from(r"C:\Users\test\project.git"),
            ),
            // Multiple slashes
            (
                "file:////C:/Users/test/project",
                PathBuf::from(r"C:\Users\test\project"),
            ),
            // original issue case
            (
                "file://C:\\repos\\myproject",
                PathBuf::from(r"C:\repos\myproject"),
            ),
        ];

        for (input, expected_suffix) in test_cases {
            let result = RepositoryConfig::resolve_dir(input);
            assert!(
                result.ends_with(&expected_suffix),
                "Failed for input:\n  {}\nExpected suffix:\n  {:?}\nGot:\n  {:?}",
                input,
                expected_suffix,
                result
            );
        }
    }

    #[test]
    #[cfg(unix)]
    fn test_resolve_dir_handles_various_file_urls_unix() {
        use std::path::PathBuf;

        let test_cases = vec![
            // Standard Unix-style file URL
            (
                "file:///home/user/project",
                PathBuf::from("/home/user/project"),
            ),
            // File URL with trailing slash