diff --git a/src/vs/workbench/services/backup/node/backupFileService.ts b/src/vs/workbench/services/backup/node/backupFileService.ts index d2e761893490f096ff81ec3749c5bfc3e5206cb2..d20e1cac212f65e1cdc7c442b48b41aa2d9e2092 100644 --- a/src/vs/workbench/services/backup/node/backupFileService.ts +++ b/src/vs/workbench/services/backup/node/backupFileService.ts @@ -8,7 +8,6 @@ import * as path from 'path'; import * as crypto from 'crypto'; import pfs = require('vs/base/node/pfs'); -import * as platform from 'vs/base/common/platform'; import Uri from 'vs/base/common/uri'; import { Queue } from 'vs/base/common/async'; import { IBackupFileService, BACKUP_FILE_UPDATE_OPTIONS } from 'vs/workbench/services/backup/common/backup'; @@ -253,9 +252,6 @@ export class BackupFileService implements IBackupFileService { } private hashPath(resource: Uri): string { - // Windows and Mac paths are case insensitive, we want backups to be too - const caseAwarePath = platform.isWindows || platform.isMacintosh ? resource.fsPath.toLowerCase() : resource.fsPath; - - return crypto.createHash('md5').update(caseAwarePath).digest('hex'); + return crypto.createHash('md5').update(resource.fsPath).digest('hex'); } } diff --git a/src/vs/workbench/services/backup/test/backupFileService.test.ts b/src/vs/workbench/services/backup/test/backupFileService.test.ts index 5bf8ba31b4fd4fe740f5963b80dd71915225b6ab..047e0d2b6d8fa9972c2b67999e2c53f06c28a46f 100644 --- a/src/vs/workbench/services/backup/test/backupFileService.test.ts +++ b/src/vs/workbench/services/backup/test/backupFileService.test.ts @@ -45,7 +45,7 @@ const barFile = Uri.file(platform.isWindows ? 'c:\\bar' : '/bar'); const untitledFile = Uri.from({ scheme: 'untitled', path: 'Untitled-1' }); const fooBackupPath = path.join(workspaceBackupPath, 'file', crypto.createHash('md5').update(fooFile.fsPath).digest('hex')); const barBackupPath = path.join(workspaceBackupPath, 'file', crypto.createHash('md5').update(barFile.fsPath).digest('hex')); -const untitledBackupPath = path.join(workspaceBackupPath, 'untitled', crypto.createHash('md5').update(platform.isLinux ? untitledFile.fsPath : untitledFile.fsPath.toLowerCase()).digest('hex')); +const untitledBackupPath = path.join(workspaceBackupPath, 'untitled', crypto.createHash('md5').update(untitledFile.fsPath).digest('hex')); class TestBackupFileService extends BackupFileService { constructor(workspace: Uri, backupHome: string, workspacesJsonPath: string) { @@ -98,25 +98,10 @@ suite('BackupFileService', () => { // Format should be: /// const backupResource = Uri.from({ scheme: 'untitled', path: 'Untitled-1' }); const workspaceHash = crypto.createHash('md5').update(workspaceResource.fsPath).digest('hex'); - const filePathHash = crypto.createHash('md5').update(platform.isLinux ? backupResource.fsPath : backupResource.fsPath.toLowerCase()).digest('hex'); + const filePathHash = crypto.createHash('md5').update(backupResource.fsPath).digest('hex'); const expectedPath = Uri.file(path.join(backupHome, workspaceHash, 'untitled', filePathHash)).fsPath; assert.equal(service.getBackupResource(backupResource).fsPath, expectedPath); }); - - test('should ignore case on Windows and Mac', () => { - // Skip test on Linux - if (platform.isLinux) { - return; - } - - if (platform.isMacintosh) { - assert.equal(service.getBackupResource(Uri.file('/foo')).fsPath, service.getBackupResource(Uri.file('/FOO')).fsPath); - } - - if (platform.isWindows) { - assert.equal(service.getBackupResource(Uri.file('c:\\foo')).fsPath, service.getBackupResource(Uri.file('C:\\FOO')).fsPath); - } - }); }); suite('hasBackup', () => {