aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/magit-diff.el11
-rw-r--r--lisp/magit-files.el17
-rw-r--r--lisp/magit-git.el3
-rw-r--r--lisp/magit-gitignore.el24
4 files changed, 25 insertions, 30 deletions
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 9d46576..4ccc51b 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -1136,12 +1136,11 @@ and `:slant'."
:multi-value t)
(defun magit-read-files (prompt initial-input history &optional list-fn)
- (magit-with-toplevel
- (magit-completing-read-multiple prompt
- (funcall (or list-fn #'magit-list-files))
- nil nil
- (or initial-input (magit-file-at-point))
- history)))
+ (magit-completing-read-multiple prompt
+ (funcall (or list-fn #'magit-list-files))
+ nil nil
+ (or initial-input (magit-file-at-point))
+ history))
(transient-define-argument magit-diff:-U ()
:description "Context lines"
diff --git a/lisp/magit-files.el b/lisp/magit-files.el
index f98edee..6ad6b19 100644
--- a/lisp/magit-files.el
+++ b/lisp/magit-files.el
@@ -710,15 +710,14 @@ Git, then fallback to using `delete-file'."
(car (member (or default (magit-current-file)) files)))))
(defun magit-read-file (prompt &optional tracked-only)
- (magit-with-toplevel
- (let ((choices (nconc (magit-list-files)
- (and (not tracked-only)
- (magit-untracked-files)))))
- (magit-completing-read
- prompt choices nil t nil nil
- (car (member (or (magit-section-value-if '(file submodule))
- (magit-file-relative-name nil tracked-only))
- choices))))))
+ (let ((choices (nconc (magit-list-files)
+ (and (not tracked-only)
+ (magit-untracked-files)))))
+ (magit-completing-read
+ prompt choices nil t nil nil
+ (car (member (or (magit-section-value-if '(file submodule))
+ (magit-file-relative-name nil tracked-only))
+ choices)))))
(defun magit-read-tracked-file (prompt)
(magit-read-file prompt t))
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index c09bb7f..f3d9341 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1126,7 +1126,8 @@ a bare repository."
;;;; File Lists
(defun magit-list-files (&rest args)
- (apply #'magit-git-items "ls-files" "-z" "--full-name" args))
+ (magit-with-toplevel
+ (apply #'magit-git-items "ls-files" "-z" args)))
(defun magit-tracked-files (&rest args)
(magit-list-files "--cached" args))
diff --git a/lisp/magit-gitignore.el b/lisp/magit-gitignore.el
index 8fd239b..d6fbf4d 100644
--- a/lisp/magit-gitignore.el
+++ b/lisp/magit-gitignore.el
@@ -158,11 +158,10 @@ Rules that are defined in that file affect all local repositories."
"Call \"git update-index --skip-worktree -- FILE\"."
(interactive
(list (magit-read-file-choice "Skip worktree for"
- (magit-with-toplevel
- (cl-set-difference
- (magit-list-files)
- (magit-skip-worktree-files)
- :test #'equal)))))
+ (cl-set-difference
+ (magit-list-files)
+ (magit-skip-worktree-files)
+ :test #'equal))))
(magit-with-toplevel
(magit-run-git "update-index" "--skip-worktree" "--" file)))
@@ -171,8 +170,7 @@ Rules that are defined in that file affect all local repositories."
"Call \"git update-index --no-skip-worktree -- FILE\"."
(interactive
(list (magit-read-file-choice "Do not skip worktree for"
- (magit-with-toplevel
- (magit-skip-worktree-files)))))
+ (magit-skip-worktree-files))))
(magit-with-toplevel
(magit-run-git "update-index" "--no-skip-worktree" "--" file)))
@@ -183,11 +181,10 @@ Rules that are defined in that file affect all local repositories."
"Call \"git update-index --assume-unchanged -- FILE\"."
(interactive
(list (magit-read-file-choice "Assume file to be unchanged"
- (magit-with-toplevel
- (cl-set-difference
- (magit-list-files)
- (magit-assume-unchanged-files)
- :test #'equal)))))
+ (cl-set-difference
+ (magit-list-files)
+ (magit-assume-unchanged-files)
+ :test #'equal))))
(magit-with-toplevel
(magit-run-git "update-index" "--assume-unchanged" "--" file)))
@@ -196,8 +193,7 @@ Rules that are defined in that file affect all local repositories."
"Call \"git update-index --no-assume-unchanged -- FILE\"."
(interactive
(list (magit-read-file-choice "Do not assume file to be unchanged"
- (magit-with-toplevel
- (magit-assume-unchanged-files)))))
+ (magit-assume-unchanged-files))))
(magit-with-toplevel
(magit-run-git "update-index" "--no-assume-unchanged" "--" file)))