[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit 9007bcfdb5 5/5: magit-read-file{, s}: Don't lim
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit 9007bcfdb5 5/5: magit-read-file{, s}: Don't limit to current directory |
Date: |
Sun, 11 Jun 2023 12:59:45 -0400 (EDT) |
branch: elpa/git-commit
commit 9007bcfdb520f32befd48f8bf8c228e2a065f9e4
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit-read-file{,s}: Don't limit to current directory
---
lisp/magit-diff.el | 11 ++++++-----
lisp/magit-files.el | 17 +++++++++--------
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index f1df583bf5..9ba7d67561 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -982,11 +982,12 @@ and `:slant'."
:multi-value t)
(defun magit-read-files (prompt initial-input history &optional list-fn)
- (magit-completing-read-multiple prompt
- (funcall (or list-fn #'magit-list-files))
- nil nil
- (or initial-input (magit-file-at-point))
- history))
+ (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)))
(transient-define-argument magit-diff:-U ()
:description "Context lines"
diff --git a/lisp/magit-files.el b/lisp/magit-files.el
index 9d9f6dcf72..581606ac35 100644
--- a/lisp/magit-files.el
+++ b/lisp/magit-files.el
@@ -499,14 +499,15 @@ Git, then fallback to using `delete-file'."
(car (member (or default (magit-current-file)) files)))))
(defun magit-read-file (prompt &optional tracked-only)
- (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)))))
+ (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))))))
(defun magit-read-tracked-file (prompt)
(magit-read-file prompt t))
- [nongnu] elpa/git-commit updated (508041d084 -> 9007bcfdb5), ELPA Syncer, 2023/06/11
- [nongnu] elpa/git-commit 0286d4937b 1/5: Revert "Ignore magit-buffer-topdir when preparing another buffer", ELPA Syncer, 2023/06/11
- [nongnu] elpa/git-commit 61cd60151d 2/5: Revert "Memorize gitdir and topdir for each Magit buffer", ELPA Syncer, 2023/06/11
- [nongnu] elpa/git-commit 2aa907e4d3 4/5: magit-do-async-shell-command: Use magit-read-file, ELPA Syncer, 2023/06/11
- [nongnu] elpa/git-commit 9007bcfdb5 5/5: magit-read-file{, s}: Don't limit to current directory,
ELPA Syncer <=
- [nongnu] elpa/git-commit 5407ac4733 3/5: magit-read-file: Cosmetics, ELPA Syncer, 2023/06/11