     (unless files
       (push (file-relative-name (read-file-name "File to ignore: " nil nil t)) files))
     (dolist (f files) (git-append-to-ignore f))
-    (git-update-status-files files 'ignored)
+    (git-update-status-files files)
     (git-success-message "Ignored" files)))
 
 (defun git-remove-file ()

		    (git-file-type-as-string old-perm new-perm)
		    (git-rename-as-string info)))))

(defun git-insert-info-list (status infolist)
  "Insert a list of file infos in the status buffer, replacing existing ones if any."
  (setq infolist (sort infolist
                       (lambda (info1 info2)
                         (string-lessp (git-fileinfo->name info1)
                                       (git-fileinfo->name info2)))))
  (let ((info (pop infolist))
        (node (ewoc-nth status 0)))
    (while info
      (cond ((not node)
	     (setq node (ewoc-enter-last status info))
             (setq info (pop infolist)))
            ((string-lessp (git-fileinfo->name (ewoc-data node))
                           (git-fileinfo->name info))
             (setq node (ewoc-next status node)))
            ((string-equal (git-fileinfo->name (ewoc-data node))
                           (git-fileinfo->name info))
              ;; preserve the marked flag
              (setf (git-fileinfo->marked info) (git-fileinfo->marked (ewoc-data node)))
	      (setf (git-fileinfo->needs-refresh info) t)
              (setf (ewoc-data node) info)
              (setq info (pop infolist)))
            (t
	     (setq node (ewoc-enter-before status node info))
             (setq info (pop infolist)))))))

(defun git-run-diff-index (status files)
  "Run git-diff-index on FILES and parse the results into STATUS.
Return the list of files that haven't been handled."
  (let ((remaining (copy-sequence files))
	infolist)
    (with-temp-buffer
      (apply #'git-call-process t "diff-index" "-z" "-M" "HEAD" "--" files)
      (goto-char (point-min))

           (concat "--exclude-per-directory=" git-per-dir-ignore-file)
           (append options (mapcar (lambda (f) (concat "--exclude-from=" f)) exclude-files)))))

(defun git-update-status-files (&optional files)
  "Update the status of FILES from the index."
  (unless git-status (error "Not in git-status buffer."))
  ;; set the needs-update flag on existing files
  (if (setq files (sort files #'string-lessp))
      (git-status-filenames-map
       git-status (lambda (info) (setf (git-fileinfo->needs-update info) t)) files)
    (ewoc-map (lambda (info) (setf (git-fileinfo->needs-update info) t) nil) git-status)
    (git-call-process nil "update-index" "--refresh")
    (when git-show-uptodate
      (git-run-ls-files-cached git-status nil 'uptodate)))
  (let* ((remaining-files
          (if (git-empty-db-p) ; we need some special handling for an empty db
	      (git-run-ls-files-cached git-status files 'added)
