git.el: Allow the add and remove commands to be applied to ignored files.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Alexandre Julliard 2007-09-13 11:50:29 +02:00 committed by Junio C Hamano
parent 98acc3fabc
commit 568d2cde9b

View File

@ -902,7 +902,7 @@ Return the list of files that haven't been handled."
(defun git-add-file () (defun git-add-file ()
"Add marked file(s) to the index cache." "Add marked file(s) to the index cache."
(interactive) (interactive)
(let ((files (git-get-filenames (git-marked-files-state 'unknown)))) (let ((files (git-get-filenames (git-marked-files-state 'unknown 'ignored))))
(unless files (unless files
(push (file-relative-name (read-file-name "File to add: " nil nil t)) files)) (push (file-relative-name (read-file-name "File to add: " nil nil t)) files))
(apply #'git-run-command nil nil "update-index" "--add" "--" files) (apply #'git-run-command nil nil "update-index" "--add" "--" files)
@ -920,7 +920,7 @@ Return the list of files that haven't been handled."
(defun git-remove-file () (defun git-remove-file ()
"Remove the marked file(s)." "Remove the marked file(s)."
(interactive) (interactive)
(let ((files (git-get-filenames (git-marked-files-state 'added 'modified 'unknown 'uptodate)))) (let ((files (git-get-filenames (git-marked-files-state 'added 'modified 'unknown 'uptodate 'ignored))))
(unless files (unless files
(push (file-relative-name (read-file-name "File to remove: " nil nil t)) files)) (push (file-relative-name (read-file-name "File to remove: " nil nil t)) files))
(if (yes-or-no-p (if (yes-or-no-p