Document why empty diff sections are no problem.

Remove debug output for numstat diffs.
This commit is contained in:
Marius Vollmer 2009-07-27 22:03:35 +03:00
parent 07269f1782
commit 3e77accab9

View file

@ -1568,6 +1568,12 @@ Please see the manual for a complete description of Magit.
(deleted (string-to-number (match-string 2)))
(file (match-string-no-properties 3))
(magit-section-hidden-default magit-hide-diffs))
;; The 'diff' section that is created here will not work with
;; magit-insert-diff-item-patch etc when we leave it empty.
;; Luckily, numstat diffs are only produced for staged and
;; unstaged changes, and we never call
;; magit-insert-diff-item-patch on them. This is a bit
;; brittle, of course.
(magit-with-section file 'diff
(delete-region (point) (+ (line-end-position) 1))
(if (or (not (magit-section-hidden magit-top-section))
@ -1575,7 +1581,7 @@ Please see the manual for a complete description of Magit.
(magit-insert-diff file)
(magit-set-section-info (list 'modified file nil))
(magit-set-section-needs-refresh-on-show t)
(insert (format "\tModified %s (+%d -%d)\n" file added deleted))))
(insert (format "\tModified %s\n" file))))
t)
nil))