mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Fix path standardization on case-sensitive file systems.
This commit is contained in:
@@ -194,17 +194,16 @@ export default class GitRepositoryAsync {
|
||||
workingDirectory = `${workingDirectory}/`
|
||||
}
|
||||
|
||||
const originalPath = _path
|
||||
if (this.isCaseInsensitive) {
|
||||
const lowerCasePath = _path.toLowerCase()
|
||||
|
||||
_path = _path.toLowerCase()
|
||||
workingDirectory = workingDirectory.toLowerCase()
|
||||
if (lowerCasePath.indexOf(workingDirectory) === 0) {
|
||||
return _path.substring(workingDirectory.length)
|
||||
} else {
|
||||
if (lowerCasePath === workingDirectory) {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_path.indexOf(workingDirectory) === 0) {
|
||||
return originalPath.substring(workingDirectory.length)
|
||||
} else if (_path === workingDirectory) {
|
||||
return ''
|
||||
}
|
||||
|
||||
return _path
|
||||
|
||||
Reference in New Issue
Block a user