From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id 4MeWApTHsF8ZKQAAsNZ9tg (envelope-from ) for ; Sun, 15 Nov 2020 06:15:48 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id gBsMOpPHsF+aYwAA1q6Kng (envelope-from ) for ; Sun, 15 Nov 2020 06:15:47 +0000 Received: from pb-smtp20.pobox.com (pb-smtp20.pobox.com [173.228.157.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 88B5B94011A for ; Sun, 15 Nov 2020 06:15:47 +0000 (UTC) Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 3B870107553; Sun, 15 Nov 2020 01:15:46 -0500 (EST) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=nn1Y1eVumf/YMAzETVMRxZ8RW yw=; b=W6jWEHPSdJ+aQjixHsIeVzBb8soyPx1KM79PH+zgZWr2L10J9nHVRQ2Qn B2tj7KvnpRTxMo5C4cZ2Lkz98YFbPrN+gwQIV9gqpXpPGdQgHK4TtBT6tXJoxrFH z3n+hAjCn6eW086ikOYbCfqKIfRhA3DvgyUrElSQgNJf4WbEJw= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 3439A107550; Sun, 15 Nov 2020 01:15:46 -0500 (EST) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:cc:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=mesmtp; bh=itZsIN7YfkqiQKvW0rD4tfSpplAkifryRqrJ3YHOsu4=; b=wulZ25BqG8Vc4pktX4F+GbzuCbmea0qM2ER1hETGzvz/6JUAo510Bc34XfJKYDKG2Dc/2CH+MGMZZZYehUQtW2oRM2h8WRdZDAGB/YlR/oThym1YpAzaXcQWKCfucBRmdsZmwzRDvK5acMW3QdkGnZZchGjulxyPEY01fRoOve8= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 9EB1010751F; Sun, 15 Nov 2020 01:15:43 -0500 (EST) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: piem@inbox.kyleam.com Cc: zimoun Subject: [PATCH 2/6] piem-am: Store "empty string" branch check Date: Sun, 15 Nov 2020 01:15:14 -0500 Message-Id: <20201115061518.22191-3-kyle@kyleam.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201115061518.22191-1-kyle@kyleam.com> References: <20201115061518.22191-1-kyle@kyleam.com> MIME-Version: 1.0 X-Pobox-Relay-ID: FE207CB0-2709-11EB-B3FB-E43E2BB96649-24757444!pb-smtp20.pobox.com Content-Transfer-Encoding: quoted-printable X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=W6jWEHPS; dkim=fail (body hash did not verify) header.d=kyleam.com header.s=mesmtp header.b=wulZ25Bq; dmarc=none; spf=pass (aspmx1.migadu.com: domain of kyle@kyleam.com designates 173.228.157.52 as permitted sender) smtp.mailfrom=kyle@kyleam.com X-Spam-Score: 2.50 X-TUID: uvMvKMuTFRBR This will be needed in another spot. --- piem.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/piem.el b/piem.el index 8ee5b0b..a42ab3d 100644 --- a/piem.el +++ b/piem.el @@ -669,9 +669,10 @@ (defun piem-am (mbox &optional format info coderepo) (interactivep (eq (car-safe mbox) :interactive))) (when interactivep (setq mbox (cdr mbox))) - (let ((new-branch (read-string - "New branch (empty for detached): " - (funcall piem-default-branch-function info))) + (let ((new-branch + (let ((b (read-string "New branch (empty for detached): " + (funcall piem-default-branch-function i= nfo)))) + (and (not (string-empty-p b)) b))) (base (completing-read "Base commit: " (let ((cands (and piem-use-magit @@ -680,9 +681,7 @@ (defun piem-am (mbox &optional format info coderepo) (base (plist-get info :base-commit))) (if base (cons base cands) cands))))) (apply #'piem-process-call nil piem-git-executable "checkout" - (append (if (string-empty-p new-branch) - (list "--detach") - (list "-b" new-branch)) + (append (if new-branch (list "-b" new-branch) (list "--deta= ch")) (and (not (string-blank-p base)) (list base))))) (let ((args (cons (concat "--patch-format=3D" format) --=20 2.29.2