Function: magit-remote-unshallow

magit-remote-unshallow is an interactive and natively compiled function defined in magit-remote.el.

Signature

(magit-remote-unshallow REMOTE)

Documentation

Convert a shallow remote into a full one.

If only a single refspec is set and it does not contain a wildcard, then also offer to replace it with the standard refspec.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/irvbdy0zra0dn8fpd008f32x5ix6qm5v-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-20261005.508/magit-remote.el
;;;###autoload
(defun magit-remote-unshallow (remote)
  "Convert a shallow remote into a full one.
If only a single refspec is set and it does not contain a
wildcard, then also offer to replace it with the standard
refspec."
  (interactive (list (or (magit-get-current-remote)
                         (magit-read-remote "Delete remote"))))
  (let ((refspecs (magit-get-all "remote" remote "fetch"))
        (standard (format "+refs/heads/*:refs/remotes/%s/*" remote)))
    (when (and (length= refspecs 1)
               (not (string-search "*" (car refspecs)))
               (yes-or-no-p (format "Also replace refspec %s with %s? "
                                    (car refspecs)
                                    standard)))
      (magit-set standard "remote" remote "fetch"))
    (magit-git-fetch "--unshallow" remote)))