diff options
author | Xinglu Chen <public@yoctocell.xyz> | 2021-04-24 13:09:42 +0200 |
---|---|---|
committer | Xinglu Chen <public@yoctocell.xyz> | 2021-04-24 13:09:42 +0200 |
commit | 5366f2fa8e73fcf5bc11d6c176cd4a27ab2f56ad (patch) | |
tree | 0c212299afdc5a264afa68fcbd14836ee1469b26 | |
parent | e02b1a318cbcba26b9f5d7159ed2d694daf49cca (diff) |
git-email-magit: Escape string with with whitespace.
Without this strings with whitespaces would cause ‘git format-patch’
to fail.
* git-email-magit.el (git-email--escape-string): New function.
(git-email-magit-patch-send): Use it.
-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 |