branch: externals/gnosis
commit b945f283ad84456783ba63ac57d9a0ae6b0683ab
Author: Thanos Apollo <[email protected]>
Commit: Thanos Apollo <[email protected]>

    [fix] vc-pull: Run migrations after pull and wrap in condition-case.
---
 gnosis.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/gnosis.el b/gnosis.el
index ea32ae43ae..8f82e5c4fc 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1703,9 +1703,14 @@ Reopens the gnosis database after successful pull."
        (cond
         ((string-match-p "finished" event)
          (when (zerop (process-exit-status proc))
-           (setf gnosis-db
-                 (emacsql-sqlite-open (expand-file-name "gnosis.db" 
gnosis-dir)))
-           (message "Gnosis: Git pull successful, database reopened")))
+          (condition-case err
+              (progn
+                (setf gnosis-db
+                       (emacsql-sqlite-open (expand-file-name "gnosis.db" 
gnosis-dir)))
+                (gnosis-db-init)
+                (message "Gnosis: Pull successful, database reopened"))
+            (error (message "Gnosis: Failed to reopen database: %s"
+                            (error-message-string err))))))
         ((string-match-p "exited abnormally" event)
          (message "Gnosis: Git pull failed with exit code %s"
                   (process-exit-status proc))))))))

Reply via email to