feat(tazjin/emacs): Add magit-find-file-worktree function
This will look up a file in the current worktree of the git repository enclosing `default-directory'. In combination with project-find-file this lets me toggle between switching to a file within a project, and within the whole depot. Change-Id: Ie1011f10051fc2c4bd4279b0944a79c7edf92f3b Reviewed-on: https://cl.tvl.fyi/c/depot/+/1838 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
parent
937469509b
commit
35b214ae9f
2 changed files with 10 additions and 3 deletions
|
|
@ -289,4 +289,11 @@
|
|||
|
||||
(add-to-list 'project-find-functions #'find-depot-project)
|
||||
|
||||
(defun magit-find-file-worktree ()
|
||||
(interactive)
|
||||
"Find a file in the current (ma)git worktree."
|
||||
(magit-find-file--internal "{worktree}"
|
||||
(magit-read-file-from-rev "HEAD" "Find file")
|
||||
#'pop-to-buffer-same-window))
|
||||
|
||||
(provide 'functions)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue