提交 2610e16b 编写于 作者: D Daniel Imms 提交者: GitHub

Merge pull request #16893 from Microsoft/tyriar/16829

Retain case in workspaces.json paths
......@@ -61,9 +61,6 @@ export class BackupMainService implements IBackupMainService {
}
private pushBackupPathsSync(workspaceIdentifier: string, isEmptyWorkspace: boolean): string {
if (!isEmptyWorkspace) {
workspaceIdentifier = this.sanitizePath(workspaceIdentifier);
}
const array = isEmptyWorkspace ? this.backups.emptyWorkspaces : this.backups.folderWorkspaces;
if (array.indexOf(workspaceIdentifier) === -1) {
array.push(workspaceIdentifier);
......
......@@ -242,6 +242,16 @@ suite('BackupMainService', () => {
done();
});
});
test('should always store the workspace path in workspaces.json using the case given, regardless of whether the file system is case-sensitive', done => {
service.registerWindowForBackupsSync(1, false, null, fooFile.fsPath.toUpperCase());
assert.deepEqual(service.getWorkspaceBackupPaths(), [fooFile.fsPath.toUpperCase()]);
pfs.readFile(backupWorkspacesPath, 'utf-8').then(buffer => {
const json = <IBackupWorkspacesFormat>JSON.parse(buffer);
assert.deepEqual(json.folderWorkspaces, [fooFile.fsPath.toUpperCase()]);
done();
});
});
});
suite('removeBackupPathSync', () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册