diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2026-04-08 08:46:28 +0200 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2026-04-08 08:46:28 +0200 |
| commit | c29f7eb3e4d398f02fb2f5c641cc277da0d7f7b3 (patch) | |
| tree | 812ffbb781eeddcef44ba364ed7b690011358b45 /lisp/magit-git.el | |
| parent | b97f0b6e68bf128b2472b32c8b4ed958e7161c8d (diff) | |
magit-list-files: Never limit to subdirectory
Never limit the list of files to those in `default-directory' and
always return paths relative to the top-level. This affects other
`magit-*-files' functions and their callers.
Some callers of these functions explicitly used `magit-with-toplevel'
and we can stop doing that now. Other callers did not use that macro
but should have done so. Among those, many were always called from the
top-level, so this bug was theoretical in those cases. Others are more
likely to be called from a subdirectory. There are no callers that
actually need just the files from a subdirectory.
Diffstat (limited to 'lisp/magit-git.el')
| -rw-r--r-- | lisp/magit-git.el | 3 |
1 files changed, 2 insertions, 1 deletions
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)) |
