   (-> (.resolve path repo-path)
       (nodegit.Repository.open)
       (.catch #(js/console.error "Something went wrong opening repo: " %))))
+
+(defn get-entry-by-sha
+  "Returns a promised value for the entry specified by the sha."
+  [repo sha]
+  (-> repo
+      (.then #(.getMasterCommit %))
+      (.then #(.getTree %))
+      (.then #(.entries %))
+      (.then (fn [entries]
+               (filterv #(= (.sha %) sha) entries)))
+      (.then #(if (empty? %) nil (first %)))))
 
 (defn get-entry-by-path
   "Returns a promise for the entry specified by filepath in repo."

;; (-> (get-all-files)
;;     (.then #(js/console.log %)))

;; (-> (get-file-by-path "test2.md")
;;     (.then #(js/console.log (clj->js %))))

                                         :created_at (:date (last file-history))
                                         :history file-history)))))))

(defn get-file-by-sha [sha]
  (-> (open-repo)
      (get-entry-by-sha sha)
      (.then #(build-entry-data %))))

(defn get-file-by-path [filepath]
  (let [rv (transient {})]
    (-> (open-repo)
