   (straight--with-plist emacsmirror-recipe
       (local-repo)
     (let ((default-directory (straight--dir "repos" local-repo)))
-      (with-temp-buffer
-        (when (straight--check-call
-               "git" "config" "-f" ".gitmodules"
-               "--get" (format "submodule.%s.url"
-                               (symbol-name package)))
-          (let ((url (string-trim (buffer-string))))
-            (if (string-match
-                 "^git@github\\.com:\\([A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+\\)\\.git$"
-                 url)
-                `(,package :fetcher github
-                           :repo ,(match-string 1 url))
-              `(,package :fetcher git
-                         :url ,url))))))))
+      (let ((url (condition-case nil
+                     (straight--get-call
+                      "git" "config" "-f" ".gitmodules"
+                      "--get" (format "submodule.%s.url"
+                                      (symbol-name package)))
+                   (error nil))))
+        (and (not (string-empty-p url))
+             (if (string-match
+                  (concat "^git@github\\.com:\\([A-Za-z0-9_.-]+"
+                          "/[A-Za-z0-9_.-]+\\)\\.git$")
+                  url)
+                 `(,package :fetcher github
+                            :repo ,(match-string 1 url))
+               `(,package :fetcher git
+                          :url ,url)))))))
 
 (defvar straight--repo-cache (make-hash-table :test 'equal))
 

        package)))))

;;;###autoload
(defun straight-save-versions ()
  (interactive)
  (with-temp-file (concat user-emacs-directory "straight/versions.el")
    (let ((versions nil))
      (straight--map-repos (lambda (recipe)
                             (straight--with-plist recipe
                                 (repo)
                               (push (cons repo (straight--get-head
                                                 repo 'validate))
                                     versions))))
      (setq versions (cl-sort versions 'string-lessp :key 'car))
      (pp versions (current-buffer)))))

;;;###autoload
(defun straight-load-versions ()
  (interactive)
  (if-let ((versions (with-temp-buffer
                       (insert-file-contents-literally
                        (straight--file "versions.el"))
                       (ignore-errors
                         (read (current-buffer))))))
      (dolist (spec versions)
        (let ((repo (car spec))
              (head (cdr spec)))
          (straight--set-head repo head)))
    (error "Could not read from %S" (straight--file "versions.el"))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Mess with other packages

    (maphash (lambda (package recipe)
               (straight--with-plist recipe
                   (local-repo)
                 (unless (member local-repo repos)
                   (funcall func recipe)
                   (push local-repo repos))))
             straight--recipe-cache)))
