Deal with empty diffs.

* magit.el (magit-create-buffer-sections): Create top section if body
hasn't created any.
This commit is contained in:
Marius Vollmer 2008-09-07 23:42:11 +03:00
parent 993354b867
commit c9164c5d0b

View file

@ -347,6 +347,9 @@ Many Magit faces inherit from this one by default."
(let ((magit-old-top-section magit-top-section))
(setq magit-top-section nil)
,@body
(when (null magit-top-section)
(magit-with-section 'top nil
(insert "(empty)\n")))
(magit-propertize-section magit-top-section)
(magit-section-set-hidden magit-top-section
(magit-section-hidden magit-top-section)))))