[emacs] Fix ssh keys not loading in magit

This commit is contained in:
2026-03-01 21:42:06 -05:00
parent a325650210
commit 748d65369a

View File

@ -453,7 +453,6 @@ Always open the result in `eww`."
(defun my/ensure-ssh-keys-loaded (&rest _ignore)
"Ensure ssh-agent has keys loaded; if not, run injector script."
(unless (my/ssh-agent-has-keys-p)
(unless (file-executable-p my/ssh-key-injector-script)
(user-error "SSH injector script not executable: %s" my/ssh-key-injector-script))
(let ((buf (get-buffer-create "*ssh-key-injector*")))
@ -461,7 +460,7 @@ Always open the result in `eww`."
(let ((exit (call-process-shell-command my/ssh-key-injector-script nil buf t)))
(unless (eq exit 0)
(display-buffer buf)
(user-error "SSH key injection failed (see *ssh-key-injector*)"))))))
(user-error "SSH key injection failed (see *ssh-key-injector*)")))))
;; IMPORTANT: remove then re-add, so we don't keep an old advised function object around
(advice-remove 'magit-status #'my/ensure-ssh-keys-loaded)