                               (condition-case nil (delete-file ".git/MERGE_HEAD") (error nil))
                               (condition-case nil (delete-file ".git/MERGE_MSG") (error nil))
                               (with-current-buffer buffer (erase-buffer))
-                              (git-update-status-files (git-get-filenames files) 'uptodate)
+                              (git-update-status-files (git-get-filenames files))
                               (git-call-process nil "rerere")
                               (git-call-process nil "gc" "--auto")
-                              (git-refresh-files)
-                              (git-refresh-ewoc-hf git-status)
                               (message "Committed %s." commit)
                               (git-run-hook "post-commit" nil)))
                         (message "Commit aborted."))))

      (setq remaining-files (git-run-ls-files-with-excludes git-status remaining-files 'unknown "-o")))
    (when (or remaining-files (and git-show-ignored (not files)))
      (setq remaining-files (git-run-ls-files-with-excludes git-status remaining-files 'ignored "-o" "-i")))
    (git-set-filenames-state git-status remaining-files default-state)
    (git-refresh-files)
    (git-refresh-ewoc-hf git-status)))


    (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)
    (git-success-message "Ignored" files)))

(defun git-remove-file ()
