@@ -267,10 +267,11 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
267267 preview = await manualSyncTask . preview ( ) ;
268268 const hasRemoteData = manualSyncTask . manifest !== null ;
269269 const hasLocalData = await this . userDataSyncService . hasLocalData ( ) ;
270- const hasChanges = preview . some ( ( [ , { resourcePreviews } ] ) => resourcePreviews . some ( r => r . localChange !== Change . None || r . remoteChange !== Change . None ) ) ;
271- const isLastSyncFromCurrentMachine = preview . every ( ( [ , { isLastSyncFromCurrentMachine } ] ) => isLastSyncFromCurrentMachine ) ;
270+ const hasMergesFromAnotherMachine = preview . some ( ( [ syncResource , { isLastSyncFromCurrentMachine, resourcePreviews } ] ) =>
271+ syncResource !== SyncResource . GlobalState && ! isLastSyncFromCurrentMachine
272+ && resourcePreviews . some ( r => r . localChange !== Change . None || r . remoteChange !== Change . None ) ) ;
272273
273- action = await this . getFirstTimeSyncAction ( hasRemoteData , hasLocalData , hasChanges , isLastSyncFromCurrentMachine ) ;
274+ action = await this . getFirstTimeSyncAction ( hasRemoteData , hasLocalData , hasMergesFromAnotherMachine ) ;
274275 const progressDisposable = manualSyncTask . onSynchronizeResources ( synchronizingResources =>
275276 synchronizingResources . length ? progress . report ( { message : localize ( 'syncing resource' , "Syncing {0}..." , getSyncAreaLabel ( synchronizingResources [ 0 ] [ 0 ] ) ) } ) : undefined ) ;
276277 try {
@@ -295,12 +296,11 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
295296 }
296297 }
297298
298- private async getFirstTimeSyncAction ( hasRemoteData : boolean , hasLocalData : boolean , hasChanges : boolean , isLastSyncFromCurrentMachine : boolean ) : Promise < FirstTimeSyncAction > {
299+ private async getFirstTimeSyncAction ( hasRemoteData : boolean , hasLocalData : boolean , hasMergesFromAnotherMachine : boolean ) : Promise < FirstTimeSyncAction > {
299300
300301 if ( ! hasLocalData /* no data on local */
301302 || ! hasRemoteData /* no data on remote */
302- || ! hasChanges /* no changes */
303- || isLastSyncFromCurrentMachine /* has changes but last sync is from current machine */
303+ || ! hasMergesFromAnotherMachine /* no merges with another machine */
304304 ) {
305305 return 'merge' ;
306306 }
0 commit comments