           (git-fileinfo->needs-refresh info) t)))
 
 (defun git-status-filenames-map (status func files &rest args)
-  "Apply FUNC to the status files names in the FILES list."
+  "Apply FUNC to the status files names in the FILES list.
+The list must be sorted."
   (when files
-    (setq files (sort files #'string-lessp))
     (let ((file (pop files))
           (node (ewoc-nth status 0)))
       (while (and file node)

                 (or (not added)
                     (apply 'git-call-process-display-error "update-index" "--force-remove" "--" added))
                 (or (not modified)
                     (apply 'git-call-process-display-error "checkout" "HEAD" modified)))))
        (git-update-status-files (append added modified))
        (when ok
          (dolist (file modified)
            (let ((buffer (get-file-buffer file)))
              (when buffer (with-current-buffer buffer (revert-buffer t t t)))))
          (git-success-message "Reverted" (git-get-filenames files)))))))

(defun git-resolve-file ()
  "Resolve conflicts in marked file(s)."

                          (mapconcat #'identity msg "\n"))))

(defun git-get-commit-files (commit)
  "Retrieve a sorted list of files modified by COMMIT."
  (let (files)
    (with-temp-buffer
      (git-call-process t "diff-tree" "-m" "-r" "-z" "--name-only" "--no-commit-id" "--root" commit)
      (goto-char (point-min))
      (while (re-search-forward "\\([^\0]*\\)\0" nil t 1)
        (push (match-string 1) files)))
    (sort files #'string-lessp)))

(defun git-read-commit-name (prompt &optional default)
  "Ask for a commit name, with completion for local branch, remote branch and tag."
