Function: vc-git-move-working-tree

vc-git-move-working-tree is a byte-compiled function defined in vc-git.el.gz.

Signature

(vc-git-move-working-tree FROM TO)

Documentation

Implementation of move-working-tree backend function for Git.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-git.el.gz
(defun vc-git-move-working-tree (from to)
  "Implementation of `move-working-tree' backend function for Git."
  (let ((v (vc-git--program-version)))
    (cond ((version<= "2.29" v)
           ;; 'git worktree move' can't move the main worktree,
           ;; but moving and then repairing can.
           (rename-file from (directory-file-name to) 1)
           (let ((default-directory to))
             (vc-git-command nil 0 nil "worktree" "repair")))
          ((version<= "2.17" v)
           ;; We lack 'git worktree repair' but have 'git worktree move'.
           (vc-git-command nil 0 nil "worktree" "move"
                           (expand-file-name from)
                           (expand-file-name to)))
          (t
           ;; We don't even have 'git worktree move'.
           (error "Your Git is too old to relocate other working trees")))))