   [dirs]
   (doseq [^File d dirs]
     (println "Fetching:" (.getPath d))
-    (git d "fetch")))
+    (git {:gitdir d} "fetch")))
 
 (defn find-project
   [pgroup pname candidate]

(set! *warn-on-reflection* true)

(defn git
  [^File d & subcmd]
  ;; We won't handle bare repos or displaced worktrees
  (let [gitdir (.getPath d)
        worktree (.getParent d)
        rtn (apply sh "git" (str "--git-dir=" gitdir) (str "--work-tree=" worktree) subcmd)]
    (when-not (zero? (:exit rtn))
      (throw (ex-info "git error" rtn)))
    rtn))

;; === git sha-based versions ===

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

