                             (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))
-                            (dolist (info files) (git-set-fileinfo-state info 'uptodate))
+			    (git-update-status-files (git-get-filenames files) 'uptodate)
                             (git-call-process-env nil nil "rerere")
                             (git-call-process-env nil nil "gc" "--auto")
                             (git-refresh-files)

(defun git-run-ls-files-cached (status files default-state)
  "Run git-ls-files -c on FILES and parse the results into STATUS.
Return the list of files that haven't been handled."
  (let (infolist)
    (with-temp-buffer
      (apply #'git-call-process-env t nil "ls-files" "-z" "-s" "-c" "--" files)
      (goto-char (point-min))

(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-env t nil "diff-index" "-z" "-M" "HEAD" "--" files)
      (goto-char (point-min))
