                                    candidates-f)]
         {:keys [sha ctime]} candidates-g]
     {:verify (when verify-newest?
-               (git {:gitdir gitdir} "checkout" (str sha))
+               (safe-checkout gitdir (str sha))
                (let [check-sha (sha/mk (:sha (get-voom-version found-path :gitdir gitdir)))]
                  (if (= check-sha sha)
                    :ok

                           (do (fetch-all dirs)
                               (locate-sha dirs sha)))]
    (mapcat (fn [c]
              (git {:gitdir c} "checkout" sha)
              (find-project groupId artifactId c))
            sha-candidates)))


                   (= name pname))]
    prj))

(defn safe-checkout [gitdir sha]
  (git {:gitdir gitdir} "clean" "-x" "-d" "--force" "--quiet")
  (git {:gitdir gitdir} "checkout" sha))

(defn find-matching-projects
  "[project {groupId name ctime sha}] [project coordinate-string]"
  [repos-dir pspec]
