git.el: Make sure we never insert the same file twice.
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 <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alexandre Julliard committed
Jan 8, 2008 at 14:45 UTC
87e3d812943f3d9c5f9464b0aee83398dd9d028e
1 file changed
+3
-3
contrib/emacs/git.el
+3
-3
@@ -608,7 +608,7 @@ and returns the process output as a string."
608
(while info
609
(setf (git-fileinfo->needs-refresh info) t)
610
(cond ((not node)
611
- (ewoc-enter-last status info)
611
+ (setq node (ewoc-enter-last status info))
612
(setq info (pop infolist)))
613
((string-lessp (git-fileinfo->name (ewoc-data node))
614
(git-fileinfo->name info))
@@ -620,7 +620,7 @@ and returns the process output as a string."
620
(setf (ewoc-data node) info)
621
(setq info (pop infolist)))
622
(t
623
- (ewoc-enter-before status node info)
623
+ (setq node (ewoc-enter-before status node info))
624
(setq info (pop infolist)))))))
625
626
(defun git-run-diff-index (status files)
@@ -677,7 +677,7 @@ Return the list of files that haven't been handled."
677
(with-temp-buffer
678
(apply #'git-call-process-env t nil "ls-files" "-z" "-s" "-c" "--" files)
679
(goto-char (point-min))
680
- (while (re-search-forward "\\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} [0-3]\t\\([^\0]+\\)\0" nil t)
680
+ (while (re-search-forward "\\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} 0\t\\([^\0]+\\)\0" nil t)
681
(let* ((new-perm (string-to-number (match-string 1) 8))
682
(old-perm (if (eq default-state 'added) 0 new-perm))
683
(name (match-string 2)))