       (finally 
         (.close stream)))))
 
-(defn- open-diff [ent side reader]
-  (let [mode (.getMode ent side)]
+(defn- open-diff [^DiffEntry entry side ^ObjectReader reader]
+  (let [mode (.getMode entry side)]
     (when (and (not= FileMode/MISSING mode)
                (= Constants/OBJ_BLOB (.getObjectType mode)))
-      (let [id (complete-id ent side reader)
-            path (.getPath ent side)]
+      (let [id (complete-id entry side reader)
+            path (.getPath entry side)]
         (load-obj id path reader)))))
 
-(defn- parse-diff-changes [entry alg reader]
+(defn- parse-diff-changes [^DiffEntry entry ^DiffAlgorithm alg ^ObjectReader reader]
   (when-not (or (= FileMode/GITLINK (.getOldMode entry))
                 (= FileMode/GITLINK (.getNewMode entry))
                 (nil? (.getOldId entry))

      (.setNoCheckout true))
    (.call)))

(defn load-repo [url]
  (let [path (data-dir url)]
    (if (.exists (io/as-file path))
      (doto (jgit.p/load-repo path)

     :new-file (merge new-file (:new-file diff-changes))
     :diff (:diff diff-changes)}))

(defn- tree-iterator ^AbstractTreeIterator [^RevCommit commit ^ObjectReader reader]
  (if commit
    (doto (CanonicalTreeParser.) (.reset reader (.getTree commit)))
    (EmptyTreeIterator.)))
