doom//upgrade: git reset instead of pull + error handling

This commit is contained in:
Henrik Lissner 2018-05-28 14:26:45 +02:00
parent 2ffef6edce
commit 61b22c1c7f
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -258,9 +258,12 @@ recompile. Run this whenever you:
(error "Aborted")
(message "Removing byte-compiled files from your config (if any)")
(doom//clean-byte-compiled-files)
(unless (zerop (process-file "git" nil buf nil "pull" "--rebase"))
(unless (zerop (process-file "git" nil buf nil "reset" "--hard"
(format "%s/%s" doom-repo-remote branch)))
(error "An error occurred while checking out the latest commit\n\n%s"
(buffer-string)))
(unless (equal (vc-git-working-revision doom-emacs-dir) rev)
(error "Failed to checkout latest commit.\n\n%s" (buffer-string)))
(doom//reload)
(message "Done! Please restart Emacs for changes to take effect")))))))))