branch: elpa/magit commit 3dcff7ece5f3e3fe9bb1fe59d54b9c12991234b9 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
magit-file-untrack: Move definition Order definitions the same as these commands are ordered in the menu. --- lisp/magit-files.el | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lisp/magit-files.el b/lisp/magit-files.el index f361254aeb..2519d302df 100644 --- a/lisp/magit-files.el +++ b/lisp/magit-files.el @@ -419,6 +419,21 @@ the same location in the respective file in the working tree." ;;; File Commands +;;;###autoload +(defun magit-file-untrack (files &optional force) + "Untrack the selected FILES or one file read in the minibuffer. + +With a prefix argument FORCE do so even when the files have +staged as well as unstaged changes." + (interactive (list (or (if-let ((files (magit-region-values 'file t))) + (if (magit-file-tracked-p (car files)) + (magit-confirm-files 'untrack files "Untrack") + (user-error "Already untracked")) + (list (magit-read-tracked-file "Untrack file")))) + current-prefix-arg)) + (magit-with-toplevel + (magit-run-git "rm" "--cached" (and force "--force") "--" files))) + ;;;###autoload (defun magit-file-rename (file newname) "Rename or move FILE to NEWNAME. @@ -456,21 +471,6 @@ Git, fallback to using `rename-file'." (vc-find-file-hook)))))) (magit-refresh)) -;;;###autoload -(defun magit-file-untrack (files &optional force) - "Untrack the selected FILES or one file read in the minibuffer. - -With a prefix argument FORCE do so even when the files have -staged as well as unstaged changes." - (interactive (list (or (if-let ((files (magit-region-values 'file t))) - (if (magit-file-tracked-p (car files)) - (magit-confirm-files 'untrack files "Untrack") - (user-error "Already untracked")) - (list (magit-read-tracked-file "Untrack file")))) - current-prefix-arg)) - (magit-with-toplevel - (magit-run-git "rm" "--cached" (and force "--force") "--" files))) - ;;;###autoload (defun magit-file-delete (files &optional force) "Delete the selected FILES or one file read in the minibuffer.