Function: majutsu-git-clone
majutsu-git-clone is an interactive and natively compiled function
defined in majutsu-git.el.
Signature
(majutsu-git-clone ARGS)
Documentation
Clone a Git repo into a new jj repo.
Prompts for SOURCE and optional DEST; uses ARGS.
Key Bindings
This command is not in any keymaps.
Source Code
;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-git.el
(defun majutsu-git-clone (args)
"Clone a Git repo into a new jj repo.
Prompts for SOURCE and optional DEST; uses ARGS."
(interactive (list (transient-args 'majutsu-git-clone-transient)))
(let* ((source (majutsu-git--url-or-path-arg
(majutsu-git--read-url-or-path "Source (URL or path)")))
(dest (let ((d (read-directory-name "Destination (optional): " nil nil nil)))
(when (and d (not (string-empty-p (expand-file-name d))))
;; If user picks current dir, treat as empty and let jj default
(let ((dd (directory-file-name d)))
(if (string= dd (directory-file-name default-directory)) nil dd)))))
(dest-arg (and dest (majutsu-convert-filename-for-jj dest)))
(cmd-args (append '("clone") args (list source) (and dest-arg (list dest-arg)))))
(majutsu--message-with-log "Cloning repository...")
(majutsu-git--start cmd-args "Clone completed")))