             (setq file (pop files))))))))
 
 (defun git-set-filenames-state (status files state)
-  "Set the state of a list of named files."
+  "Set the state of a list of named files. The list must be sorted"
   (when files
     (git-status-filenames-map status #'git-set-fileinfo-state files state)
     (unless state  ;; delete files whose state has been set to nil

          (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."
  (when files
    (setq files (sort files #'string-lessp))
    (let ((file (pop files))
          (node (ewoc-nth status 0)))
      (while (and file node)

                          (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."
