   (cond
    ((eq depth 'full)
     ;; Clone the whole history of the repository.
-    (apply #'straight--get-call
+    (apply #'straight--process-output
            "git" "clone" "--origin" remote
            "--no-checkout" url repo-dir
            (when branch `("--branch" ,branch))))

       ;; Detached HEAD, either attach to configured branch
       ;; automatically or ask the user.
       (if straight-vc-git-auto-fast-forward
           (straight--get-call "git" "checkout" branch)
         (straight-vc-git--popup
           (format
            "In repository %S, HEAD is even with branch %S, but detached."
            local-repo branch)
           ("a" (format "Attach HEAD to branch %S" branch)
            (straight--get-call "git" "checkout" branch)))))
      (t
       ;; ref-ahead-p and ref-behind-p determine whether the local
       ;; copy is ahead or behind ref. When the branch is different,
       ;; though, it's not a question of being ahead or behind, the
       ;; state can be more complex than that, so we consider it
       ;; neither ahead nor behind.
       (let ((ref-ahead-p (straight--check-call
                           "git" "merge-base" "--is-ancestor"
                           cur-branch ref-name))
             (ref-behind-p (straight--check-call
                            "git" "merge-base" "--is-ancestor"
                            ref-name cur-branch)))
         (when (and ref ref-behind-p)
           (cl-return-from straight-vc-git--ensure-head t))
         (when (and ref ref-ahead-p straight-vc-git-auto-fast-forward)
           ;; Local is behind, catch up.
           (straight--get-call "git" "reset" "--hard" ref-name)
           ;; Return nil to signal that we're not quite done. In some
           ;; cases a reset might leave untracked files.
           (cl-return-from straight-vc-git--ensure-head nil))

        ("z" "Stash changes"
         (let ((msg (read-string "Optional stash message: ")))
           (if (string-empty-p msg)
               (straight--process-output
                "git" "stash" "push" "--include-untracked")
             (straight--process-output
              "git" "stash" "save" "--include-untracked" msg))))
        ("d" "Discard changes"
         (when (straight-are-you-sure
                (format "Discard all local changes permanently?"))
           (and (straight--process-output "git" "reset" "--hard")
                (straight--process-output "git" "clean" "-ffd"))))))))

(cl-defun straight-vc-git--ensure-head (local-repo branch &optional ref)
  "Ensure that LOCAL-REPO has BRANCH checked out.
