瀏覽代碼

Implement move

master
10sr 6 年之前
父節點
當前提交
d40125c9f9
簽署人: 10sr GPG Key ID: 7BEC428194130EB2
共有 1 個文件被更改,包括 13 次插入8 次删除
  1. +13
    -8
      emacs.el

+ 13
- 8
emacs.el 查看文件

@@ -2164,20 +2164,25 @@ initializing."
(interactive)
(let* ((id (tabulated-list-get-id))
(path (plist-get id :worktree)))
(when path
(if (file-directory-p path)
(dired path)
(error "Directory not found: %s" path)))))
(cl-assert path nil "No worktree info at point")
(cl-assert (file-directory-p path) t "Directory not found")
(dired path)))

(defun git-worktree-mode-move ()
"Move worktree at point to a new location."
(interactive)
(let* ((id (tabulated-list-get-id))
(path (plist-get id :worktree)))
(when path
(if (file-directory-p path)
(dired path)
(error "Directory not found: %s" path)))))
(cl-assert path nil "No worktree info at point")
(cl-assert (file-directory-p path) t "Directory not found")
(let ((new (read-file-name (format "New name for worktree %s: "
path))))
(with-temp-buffer
(git-worktree--call-process "worktree"
"move"
path
(expand-file-name new)))
(revert-buffer))))

(defvar git-worktree-mode-map
(let ((map (make-sparse-keymap)))


Loading…
取消
儲存