mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 08:03:39 +00:00
fix(ai-vault): preserve case-sensitive WSL mount paths
This commit is contained in:
@@ -30,6 +30,10 @@ describe('wslRootPathAliases', () => {
|
||||
'/mnt/c/Users/neil/orca',
|
||||
String.raw`C:\Users\neil\orca`
|
||||
])
|
||||
expect(wslRootPathAliases(String.raw`\\wsl.localhost\Ubuntu\mnt\C\Repo`)).toEqual([
|
||||
String.raw`\\wsl.localhost\Ubuntu\mnt\C\Repo`,
|
||||
'/mnt/C/Repo'
|
||||
])
|
||||
})
|
||||
|
||||
it('does not invent aliases for an ordinary POSIX path', () => {
|
||||
@@ -77,6 +81,10 @@ describe('isWslAliasedPathInsideOrEqual', () => {
|
||||
).toBe(false)
|
||||
})
|
||||
|
||||
it('does not reinterpret a case-variant /mnt/C directory as a drive mount', () => {
|
||||
expect(isWslAliasedPathInsideOrEqual(String.raw`C:\Repo`, '/mnt/C/Repo/src')).toBe(false)
|
||||
})
|
||||
|
||||
it('preserves the distro identity of UNC candidates', () => {
|
||||
const ubuntuRoot = String.raw`\\wsl.localhost\Ubuntu\home\ada\repo`
|
||||
expect(isWslAliasedPathInsideOrEqual(ubuntuRoot, '/home/ada/repo/src')).toBe(true)
|
||||
@@ -96,6 +104,10 @@ describe('normalizedWslPathCandidateAliases', () => {
|
||||
'c:/users/neil/orca/orca'
|
||||
])
|
||||
})
|
||||
|
||||
it('keeps a case-variant /mnt/C candidate as a case-sensitive Linux path', () => {
|
||||
expect(normalizedWslPathCandidateAliases('/mnt/C/Repo')).toEqual(['/mnt/C/Repo'])
|
||||
})
|
||||
})
|
||||
|
||||
describe('wslAliasedPathDepth', () => {
|
||||
|
||||
@@ -84,7 +84,7 @@ function wslMountPathFromWindowsDrive(pathValue: string): string | null {
|
||||
}
|
||||
|
||||
function windowsDrivePathFromWslMount(pathValue: string): string | null {
|
||||
const match = pathValue.match(/^\/mnt\/([a-zA-Z])(\/.*)?$/)
|
||||
const match = pathValue.match(/^\/mnt\/([a-z])(\/.*)?$/)
|
||||
if (!match) {
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user