mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-24 01:53:20 +00:00
Fixed:
- Now we can merge JSON files even if they have entries which cannot be compared.
This commit is contained in:
1 parent
2fdc7669f3
commit
bc568ff479
1 file changed
+1
-1
+1
-1
@@ -2297,6 +2297,7 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async mergeObject(path: string, baseRev: string, currentRev: string, conflictedRev: string): Promise<string | false> {
|
async mergeObject(path: string, baseRev: string, currentRev: string, conflictedRev: string): Promise<string | false> {
|
||||||
|
try {
|
||||||
const baseLeaf = await this.getConflictedDoc(path, baseRev);
|
const baseLeaf = await this.getConflictedDoc(path, baseRev);
|
||||||
const leftLeaf = await this.getConflictedDoc(path, currentRev);
|
const leftLeaf = await this.getConflictedDoc(path, currentRev);
|
||||||
const rightLeaf = await this.getConflictedDoc(path, conflictedRev);
|
const rightLeaf = await this.getConflictedDoc(path, conflictedRev);
|
||||||
@@ -2314,7 +2315,6 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
|||||||
{ mtime: rightLeaf.mtime, patch: diffRight }
|
{ mtime: rightLeaf.mtime, patch: diffRight }
|
||||||
].sort((a, b) => a.mtime - b.mtime);
|
].sort((a, b) => a.mtime - b.mtime);
|
||||||
let newObj = { ...baseObj };
|
let newObj = { ...baseObj };
|
||||||
try {
|
|
||||||
for (const patch of patches) {
|
for (const patch of patches) {
|
||||||
newObj = applyPatch(newObj, patch.patch);
|
newObj = applyPatch(newObj, patch.patch);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user