 
 (defn setup []
  (repo-info "https://github.com/tonsky/datascript.git"))
-;  (spit "test_rails" (prn-str (repo-info "https://github.com/rails/rails.git"))))
-

           [org.eclipse.jgit.lib ObjectReader]
           [org.eclipse.jgit.api Git]
           [org.eclipse.jgit.revwalk RevWalk RevCommit RevTree]
           [org.eclipse.jgit.treewalk EmptyTreeIterator CanonicalTreeParser AbstractTreeIterator]))

(defn- data-dir [url]
  (let [repo-name (last (string/split url #"/"))]
    (str "./remotes/" repo-name "_" (util/md5 url))))

(defn load-repo [url]
  (let [path (str (data-dir url) "/repo")]
    (if (.exists (io/as-file path))
      ;; todo fetch and hard reset too
      (jgit.p/load-repo path)
      (jgit.p/git-clone url path))))

(gen-interface

            [clj-jgit.porcelain :as jgit.p]
            [clj-jgit.querying :as jgit.q]
            [clojure.java.io :as io]
            [clojure.tools.logging :as logging]
            [clojure.string :as string])
  (:import [java.security MessageDigest]
           [java.io ByteArrayOutputStream]
