summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-06-06 00:17:41 -0400
committerKyle Meyer <kyle@kyleam.com>2020-06-06 15:12:35 -0400
commitfe5b08572ea48e8224bf943b75ac25edc1ffdfad (patch)
tree48783e751574024844c0094dc7ba51f96a059157
parent91a1010c215306b81c6c1e92dfc59872b505d020 (diff)
downloadpiem-fe5b08572ea48e8224bf943b75ac25edc1ffdfad.tar.gz
Don't pass invalid starting point to 'git checkout'
If the caller doesn't enter a base, an empty string is passed as the starting point to 'git checkout', causing it to fail. Instead, map the empty string to nil, resulting in HEAD being used as the starting point.
-rw-r--r--piem.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/piem.el b/piem.el
index 800fb2c..b7b763f 100644
--- a/piem.el
+++ b/piem.el
@@ -353,7 +353,8 @@ in `piem-default-branch-function'."
(append (if (string-empty-p new-branch)
(list "--detach")
(list "-b" new-branch))
- (list base))))
+ (and (not (string-blank-p base))
+ (list base)))))
(piem-process-call nil piem-git-executable "am" "--scissors" mbox)
(if (and piem-use-magit
(fboundp 'magit-status-setup-buffer))