emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/git-commit 98a1f1d74b 5/7: magit-file-ignored-p: New funct


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 98a1f1d74b 5/7: magit-file-ignored-p: New function
Date: Sat, 20 May 2023 18:01:02 -0400 (EDT)

branch: elpa/git-commit
commit 98a1f1d74b6b9def26d15c300cf21bf1d59212c2
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    magit-file-ignored-p: New function
    
    Cannot use "git check-ignore" because it does not suppor pathspec
    magic "literal".
---
 lisp/magit-git.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 9c36ac9373..aa0ca412d5 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1097,6 +1097,10 @@ tracked file."
                       (directory-file-name (file-name-directory file))))))
       (file-relative-name file dir))))
 
+(defun magit-file-ignored-p (file)
+  (magit-git-string-p "ls-files" "--others" "--ignored" "--exclude-standard"
+                      "--" file))
+
 (defun magit-file-tracked-p (file)
   (magit-git-success "ls-files" "--error-unmatch" file))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]