       (let ((straight--default-directory nil))
         (recursive-edit)))
      ("g" "Magit and open recursive edit"
-      (magit-status-internal
-       (or straight--default-directory default-directory))
-      (let ((straight--default-directory nil))
-        (recursive-edit)))))
+      (when (straight--magit-status
+             (or straight--default-directory default-directory))
+        (let ((straight--default-directory nil))
+          (recursive-edit))))))
 
 (defun straight-vc-git--encode-url (repo host &optional protocol)
   "Generate a URL from a REPO depending on the value of HOST and PROTOCOL.

    '(("e" "Dired and open recursive edit"
       (lambda ()
         (dired (or straight--default-directory default-directory))
         (recursive-edit)))
      ("g" "Magit and open recursive edit"
       (lambda ()
         (magit-status-internal
          (or straight--default-directory default-directory))
         (recursive-edit)))))))

(defmacro straight-vc-git--popup (prompt &rest actions)
  "Same as `straight-popup', but specialized for vc-git methods.


;; `magit'
(declare-function magit-status-internal "magit-status")

;; `use-package'
(defvar use-package-defaults)
(defvar use-package-ensure-function)
(defvar use-package-keywords)
(defvar use-package-pre-ensure-function)
(declare-function use-package-as-symbol "use-package")
(declare-function use-package-only-one "use-package")
(declare-function use-package-process-keywords "use-package")

;;;; Customization variables

