                   message "\n")]
     (doseq [e tree-structs] (write-tree (:contents e)))
     (write-commit text)))
+


; Creates a new commit object (and all required tree objects)
; from the current index
(defn create-commit [message parent-hash]
  (let [[tree-hash tree-structs] (index-to-tree-objects)
        timestamp (str (current-unix-time) " +0000")
        text (str "tree " tree-hash "\n"
                  "parent " parent-hash "\n"
                  "author " (get-author) " " timestamp "\n"

          (.write wrtr bdata))
        (unset-writable filepath)))
    filepath))

(defn write-blob [text]
  (write-object (str "blob " (count text) "\0" text)))
