Added `magit-omit-untracked-dir-contents' to optionally stop magit listing everything in an untracked directory.

This commit is contained in:
Phil Jackson 2010-03-10 21:38:04 +00:00
parent 282303265f
commit 9325431ad4

View file

@ -210,6 +210,10 @@ Many Magit faces inherit from this one by default."
(defvar magit-completing-read 'completing-read (defvar magit-completing-read 'completing-read
"Function to be called when requesting input from the user.") "Function to be called when requesting input from the user.")
(defvar magit-omit-untracked-dir-contents nil
"When non-nil magit will only list an untracked directory, not
its contents.")
;;; Macros ;;; Macros
(defmacro magit-with-refresh (&rest body) (defmacro magit-with-refresh (&rest body)
@ -1490,9 +1494,13 @@ Please see the manual for a complete description of Magit.
(magit-wash-sequence #'magit-wash-untracked-file))) (magit-wash-sequence #'magit-wash-untracked-file)))
(defun magit-insert-untracked-files () (defun magit-insert-untracked-files ()
(magit-git-section 'untracked "Untracked files:" (apply 'magit-git-section
'magit-wash-untracked-files `(untracked
"ls-files" "-t" "--others" "--exclude-standard")) "Untracked files:"
magit-wash-untracked-files
"ls-files" "-t" "--others" "--exclude-standard"
,@(when magit-omit-untracked-dir-contents
'("--directory")))))
;;; Diffs and Hunks ;;; Diffs and Hunks