Skip to content

Commit

Permalink
git.el: Make sure we never insert the same file twice.
Browse files Browse the repository at this point in the history
Skip non-zero stage files during git-ls-files -c, they are handled
later. Also fix git-insert-info-list to merge duplicate file names.

Signed-off-by: Alexandre Julliard <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
julliard authored and gitster committed Jan 9, 2008
1 parent d8c3794 commit 87e3d81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contrib/emacs/git.el
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ and returns the process output as a string."
(while info
(setf (git-fileinfo->needs-refresh info) t)
(cond ((not node)
(ewoc-enter-last status info)
(setq node (ewoc-enter-last status info))
(setq info (pop infolist)))
((string-lessp (git-fileinfo->name (ewoc-data node))
(git-fileinfo->name info))
Expand All @@ -620,7 +620,7 @@ and returns the process output as a string."
(setf (ewoc-data node) info)
(setq info (pop infolist)))
(t
(ewoc-enter-before status node info)
(setq node (ewoc-enter-before status node info))
(setq info (pop infolist)))))))

(defun git-run-diff-index (status files)
Expand Down Expand Up @@ -677,7 +677,7 @@ Return the list of files that haven't been handled."
(with-temp-buffer
(apply #'git-call-process-env t nil "ls-files" "-z" "-s" "-c" "--" files)
(goto-char (point-min))
(while (re-search-forward "\\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} [0-3]\t\\([^\0]+\\)\0" nil t)
(while (re-search-forward "\\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} 0\t\\([^\0]+\\)\0" nil t)
(let* ((new-perm (string-to-number (match-string 1) 8))
(old-perm (if (eq default-state 'added) 0 new-perm))
(name (match-string 2)))
Expand Down

0 comments on commit 87e3d81

Please sign in to comment.