diff options
Diffstat (limited to 'git-email-magit.el')
-rw-r--r-- | git-email-magit.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/git-email-magit.el b/git-email-magit.el index 1f211e1..70f64b4 100644 --- a/git-email-magit.el +++ b/git-email-magit.el @@ -41,15 +41,19 @@ (require 'transient) ;;;###autoload -(defun git-email-magit-patch-send (args) +(defun git-email-magit-patch-send (args &optional commit) (interactive (let ((args (transient-args 'magit-patch-create))) (list (mapconcat #'identity (seq-filter #'stringp args) " ")))) - - (git-email-format-patch args nil t)) - + ;; For some reason, `git-email-format-patch' gets called before + ;; `magit-log-select' has retunred anything, leading to an error. + (if commit + (git-email-format-patch args commit nil) + (magit-log-select (lambda (commit) + (git-email-magit-patch-send args commit))))) + (transient-append-suffix 'magit-patch-create "c" '(1 "s" "Send patch" git-email-magit-patch-send)) |