mirror of
https://github.com/logseq/logseq.git
synced 2026-05-03 02:16:30 +00:00
enhance: commit the content in logseq when detecting any disk changes
This commit is contained in:
@@ -54,7 +54,12 @@
|
||||
(not (string/blank? content))
|
||||
(not= (string/trim content)
|
||||
(string/trim (or (db/get-file repo path) ""))))
|
||||
(p/let [result (ipc/ipc "gitCommitAll" "")
|
||||
(p/let [db-content (or (db/get-file repo path) "")
|
||||
;; save the previous content in Logseq first and commit it to avoid
|
||||
;; any data-loss.
|
||||
_ (file-handler/alter-file repo path db-content {:re-render-root? false
|
||||
:reset? false})
|
||||
result (ipc/ipc "gitCommitAll" "")
|
||||
_ (file-handler/alter-file repo path content {:re-render-root? true
|
||||
:from-disk? true})]
|
||||
(set-missing-block-ids! content)
|
||||
|
||||
Reference in New Issue
Block a user