From 328672c1f58aeba665192cebee7cf79a089ed085 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 13 Sep 2019 08:35:08 +0200 Subject: [PATCH] Merge always when remote has moved forward --- .../services/userData/common/settingsSync.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/vs/workbench/services/userData/common/settingsSync.ts b/src/vs/workbench/services/userData/common/settingsSync.ts index 79603210164dd..a266bd8ff842c 100644 --- a/src/vs/workbench/services/userData/common/settingsSync.ts +++ b/src/vs/workbench/services/userData/common/settingsSync.ts @@ -224,18 +224,9 @@ export class SettingsSynchroniser extends Disposable implements ISynchroniser { // Remote has moved forward if (remoteUserData.ref !== lastSyncData.ref) { - - // Local content is same as last synced. So, sync with remote content. - if (lastSyncData.content === localContent) { - this.logService.trace('Settings Sync: Settings file has not changed from last time synced. So replace with remote contents.'); - hasLocalChanged = true; - settingsPreview = remoteContent; - return { settingsPreview, hasLocalChanged, hasRemoteChanged, hasConflicts }; - } - - // Local content is diverged from last synced. Required merge and sync. - this.logService.trace('Settings Sync: Settings file is diverged from last time synced. Require merge and sync.'); - hasLocalChanged = hasRemoteChanged = true; + this.logService.trace('Settings Sync: Remote contents have changed. Merge and Sync.'); + hasRemoteChanged = true; + hasLocalChanged = lastSyncData.content !== localContent; const mergeResult = await this.mergeContents(localContent, remoteContent, lastSyncData.content); return { settingsPreview: mergeResult.settingsPreview, hasLocalChanged, hasRemoteChanged, hasConflicts: mergeResult.hasConflicts }; }