diff options
Diffstat (limited to 'git-email-magit.el')
-rw-r--r-- | git-email-magit.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/git-email-magit.el b/git-email-magit.el index 1f6404e..fd4e001 100644 --- a/git-email-magit.el +++ b/git-email-magit.el @@ -34,11 +34,17 @@ (require 'magit-patch) (require 'magit-log) +(defun git-email--escape-string (str) + "Escape STR if it has spaces in it." + (if (string-match-p "\s" str) + (format "\"%s\"" str) + str)) + ;;;###autoload (defun git-email-magit-patch-send (args &optional commit) (interactive (let ((args (transient-args 'magit-patch-create))) - (list (mapconcat #'identity + (list (mapconcat #'git-email--escape-string (seq-filter #'stringp args) " ")))) ;; For some reason, `git-email-format-patch' gets called before |