           df (doto (DiffFormatter. out)
                (.setRepository repo))
           [old-tree new-tree] (diff-trees repo commit)]
-      (for [diff (.scan df old-tree new-tree)]
+      (for [^DiffEntry diff (.scan df old-tree new-tree)
+            :when (or (some? commit)
+                      (not= DiffEntry$ChangeType/ADD (.getChangeType diff)))]
         (->> (format-diff! out df diff)
              string/split-lines
-             (map hu/escape-html)
+             (map escape-html)
              (map add-formatting)
              (#(conj % [:br] [:br])))))))
 

(defn create-html
  [^Git git ^RevCommit commit]
  (clj->html
    [:div {:class "head"} (or (some-> commit .getFullMessage)
                              (utils/get-string :uncommitted-changes))]
    (when commit
      (list [:div (format (utils/get-string :author)

  (:require [clojure.java.io :as io]
            [clojure.string :as string]
            [hiccup.core :as h]
            [nightcode.dialogs :as dialogs]
            [nightcode.editors :as editors]
            [nightcode.shortcuts :as shortcuts]
