   [meta branch]
   (> (count ((:branches meta) branch)) 1))
 
+
 (defn merge-necessary?
   "Determines whether branch-head is ancestor."
   [cut branch-head]

  [description author schema is-public value]
  (let [val-id (*id-fn* value)
        ts (*date-fn*)]
    {:meta {:id (*id-fn*)
            :description description
            :schema {:type "http://github.com/ghubber/geschichte"
                     :version 1}
            :public is-public
            :causal-order {val-id #{}
                           :root val-id}
            :branches {"master" #{val-id}}
            :head "master"
            :last-update ts

                (set/union source-heads target-heads)
                value)))


(defn merge-heads
  "Merge source and target heads into source branch with value as commit."
  [author schema branch source-meta source-heads target-meta target-heads value]
  (merge-lcas author schema branch source-meta source-heads target-heads value
              (lowest-common-ancestors (:causal-order source-meta)
                                       source-heads
                                       (:causal-order target-meta)
                                       target-heads)))
