103
104
export function merge(originalLocalContent: string, originalRemoteContent: string, baseContent: string | null, ignoredSettings: string[], resolvedConflicts: { key: string; value: any | undefined }[], formattingOptions: FormattingOptions): IMergeResult {
106
>
const localContentWithoutIgnoredSettings = updateIgnoredSettings(originalLocalContent, originalRemoteContent, ignoredSettings, formattingOptions);
107
>
const localForwarded = baseContent !== localContentWithoutIgnoredSettings;
108
>
const remoteForwarded = baseContent !== originalRemoteContent;
109
>
110
>
/* no changes */
111
>
if (!localForwarded && !remoteForwarded) {
112
return { conflictsSettings: [], localContent: null, remoteContent: null, hasConflicts: false };
113
}
114
115
/* local has changed and remote has not */
117
return { conflictsSettings: [], localContent: null, remoteContent: localContentWithoutIgnoredSettings, hasConflicts: false };
118
}
119
120
/* remote has changed and local has not */
122
return { conflictsSettings: [], localContent: updateIgnoredSettings(originalRemoteContent, originalLocalContent, ignoredSettings, formattingOptions), remoteContent: null, hasConflicts: false };
123
}
124
125
/* local is empty and not synced before */
126
>
if (baseContent === null && isEmpty(originalLocalContent)) {
settingsMerge.ts
127
const localContent = areSame(originalLocalContent, originalRemoteContent, ignoredSettings) ? null : updateIgnoredSettings(originalRemoteContent, originalLocalContent, ignoredSettings, formattingOptions);
128
return { conflictsSettings: [], localContent, remoteContent: null, hasConflicts: false };