             marks (into {}
                         (map #(let [[mark sha] (s/split % #" ")]
                                 [mark (sha/mk sha)])
-                             (re-seq #"(?m)^.*$" (slurp marks-file))))]
+                             (re-seq #"(?m)^.*$" (slurp marks-file))))
+            merge-commit-fn (fn [cmd commit]
+                              (if (= cmd "merge")
+                                (-> commit
+                                    (assoc :merge true)
+                                    (assoc :paths (merged-paths gitdir (-> commit :sha str))))
+                                commit))]
         (with-open [rdr (-> out
                             java.io.ByteArrayInputStream.
                             (java.io.InputStreamReader. "ISO-8859-1")

      (->> (reductions #(str %1 "/" %2)))
      (conj "")))

(defn exported-commits
  [gitdir tip-shas seen-shas]
  (let [marks-file (File/createTempFile "marks" ".txt")]

                                            (assoc commit :ctime))
                           "data" (do (.skip rdr (Long/parseLong more-line))
                                      commit)
                           ("from" "merge") (let [commit (merge-commit-fn cmd commit)]
                                              (update-in commit [:parents]
                                                         (fnil conj [])
                                                         (marks more-line)))
                           "M" (if (:merge commit)
                                 commit
                                 (let [[_ sha path] (s/split more-line #" " 3)]
                                   (update-in commit [:paths]
                                              assoc path (sha/mk sha))))
                           "D" (update-in commit [:paths] assoc more-line nil)
                           (do (println "Unparsed:" line)
                               commit)))))
