                        []
                        (map parse-tag tags))
               paths (set (map :path tspecs))]
-        path paths
-        branch (map #(re-find #"[^/]*/+[^/]*$" (str %))
-                    (glob (str gitdir "/refs/remotes/*/*")))
+        found-path paths
+        :when (or (= found-path path) (nil? path))
+        found-branch (map #(.getName ^File %)
+                          (glob (str gitdir "/refs/remotes/origin/*")))
+        :when (or (= found-branch branch) (nil? branch))
         :let [neg-tags (map #(str "^" % "^") tags)
               neg-tags (filter (partial contains-sha? gitdir) neg-tags)
               commits

                 parse-sha-refs
                 (:lines (apply git {:gitdir gitdir} "log"
                                "--pretty=format:%H,%cd,%d" "--decorate" "--reverse"
                                (concat neg-tags [branch "--" path]))))]
        :when (seq commits)]
    (let [refs (-> commits first :refs)
          reflist (filter #(and
                            (= (str proj-name) (:proj %))
                            (= path (:path %))) (map parse-tag refs))]
      (some (fn [[current next-commit]]
              #_(prn :refs path (:refs next-commit))
              (when (or (= :end next-commit)
                        (some #(= path (:path (parse-tag %)))
                              (:refs next-commit)))
                {:sha (:sha current)
                 :ctime (:ctime current)
                 :ver (-> reflist first :ver)
                 :path path
                 :proj proj-name
                 :gitdir gitdir
                 :branch branch}))
            (partition 2 1 (concat commits [:end]))))))

(defn fresh-version [[prj ver :as dep]]

   (update-in [:proj] (fnil s/replace "") #"%" "/")))

(defn newest-voom-ver-by-spec
  [proj-name ver-spec {:keys [repo branch path]}]

  (for [gitdir (all-repos-dirs)
        :let [found-repo (-> (remotes gitdir) :origin :fetch)]
        :when (or (= found-repo repo) (nil? repo))
        :let [ptn (s/join "--" ["voom"
                                (str (namespace proj-name) "%" (name proj-name))
                                (str ver-spec "*")])
