aboutsummaryrefslogtreecommitdiff
path: root/lisp/magit-git.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2026-04-08 08:46:29 +0200
committerJonas Bernoulli <jonas@bernoul.li>2026-04-08 08:46:29 +0200
commit073b01e83405031da1ed55b45cb6b649a3cfb228 (patch)
tree7da776fce06d26cec488c4333c2320545aab221f /lisp/magit-git.el
parentc29f7eb3e4d398f02fb2f5c641cc277da0d7f7b3 (diff)
magit-untracked-files: Use git-status instead of git-ls-files
The former is better at taking ignore rules into account. Remove the recently added `magit--untracked-files', which also used the former. The new `magit-untracked-files' is essentially the same as that short-lived function, but preserves its own function signature.
Diffstat (limited to 'lisp/magit-git.el')
-rw-r--r--lisp/magit-git.el16
1 files changed, 3 insertions, 13 deletions
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index f3d9341..729371d 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1133,25 +1133,15 @@ a bare repository."
(magit-list-files "--cached" args))
(defun magit-untracked-files (&optional all files &rest args)
- "Return a list of untracked files.
-
-Note that when using \"--directory\", the rules from \".gitignore\"
-files from sub-directories are ignore, which is probably a Git bug.
-See also `magit-list-untracked-files', which does not have this
-issue."
- (magit-list-files "--other" args
- (and (not all) "--exclude-standard")
- "--" files))
-
-(defun magit--untracked-files (&optional directory all)
+ "Return a list of untracked files."
(magit-with-toplevel
(seq-keep (##and (eq (aref % 0) ??)
(substring % 3))
- (magit-git-items "status" "-z" "--porcelain"
+ (magit-git-items "status" "-z" "--porcelain" args
(if all
"--untracked-files=all"
"--untracked-files=normal")
- "--" directory))))
+ "--" files))))
(defun magit-list-untracked-files (&optional files)
"Return a list of untracked files.