summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2021-05-23 17:21:50 -0400
committerKyle Meyer <kyle@kyleam.com>2022-01-15 16:39:33 -0500
commit1669fdcb02ec86379aeae5a4ff5cfa548a39ffe8 (patch)
tree55fbe38aa810fe442497e62de9ec0dca9b21f203 /lisp
parent7d07886318925ad1f7e4fc0ae3ad12113fe50f3e (diff)
downloademacs.d-1669fdcb02ec86379aeae5a4ff5cfa548a39ffe8.tar.gz
km/magit-patch-create-series: Allow base override
I sometimes want to use an outdated base.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-magit.el9
1 files changed, 4 insertions, 5 deletions
diff --git a/lisp/km-magit.el b/lisp/km-magit.el
index f6f4cdf..bd14dcb 100644
--- a/lisp/km-magit.el
+++ b/lisp/km-magit.el
@@ -881,9 +881,6 @@ appending [M/N] to each entry."
;; specified.
(when (magit-anything-modified-p t)
(user-error "There are uncommitted changes"))
- (setq args (seq-remove
- (lambda (a) (string-match-p "\\`--base=" a))
- args))
(let* ((current (magit-get-current-branch))
(upstream (or (magit-get-upstream-branch current)
(user-error "No upstream branch")))
@@ -894,8 +891,10 @@ appending [M/N] to each entry."
(concat "reset: moving back to " current)
current)
(magit-branch-checkout patch-branch))
- (apply #'magit-run-git "format-patch"
- upstream (concat "--base=" upstream) args)
+ (unless (seq-some (lambda (a) (string-match-p "\\`--base=" a))
+ args)
+ (setq args (cons (concat "--base=" upstream) args)))
+ (apply #'magit-run-git "format-patch" upstream args)
(let* ((patches (or (seq-filter
(lambda (f) (string-suffix-p ".patch" f))
(magit-untracked-files))