Skip to content

Commit 328672c

Browse files
Sandeep SomavarapuSandeep Somavarapu
authored andcommitted
Merge always when remote has moved forward
1 parent 93aeba0 commit 328672c

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

src/vs/workbench/services/userData/common/settingsSync.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -224,18 +224,9 @@ export class SettingsSynchroniser extends Disposable implements ISynchroniser {
224224

225225
// Remote has moved forward
226226
if (remoteUserData.ref !== lastSyncData.ref) {
227-
228-
// Local content is same as last synced. So, sync with remote content.
229-
if (lastSyncData.content === localContent) {
230-
this.logService.trace('Settings Sync: Settings file has not changed from last time synced. So replace with remote contents.');
231-
hasLocalChanged = true;
232-
settingsPreview = remoteContent;
233-
return { settingsPreview, hasLocalChanged, hasRemoteChanged, hasConflicts };
234-
}
235-
236-
// Local content is diverged from last synced. Required merge and sync.
237-
this.logService.trace('Settings Sync: Settings file is diverged from last time synced. Require merge and sync.');
238-
hasLocalChanged = hasRemoteChanged = true;
227+
this.logService.trace('Settings Sync: Remote contents have changed. Merge and Sync.');
228+
hasRemoteChanged = true;
229+
hasLocalChanged = lastSyncData.content !== localContent;
239230
const mergeResult = await this.mergeContents(localContent, remoteContent, lastSyncData.content);
240231
return { settingsPreview: mergeResult.settingsPreview, hasLocalChanged, hasRemoteChanged, hasConflicts: mergeResult.hasConflicts };
241232
}

0 commit comments

Comments
 (0)