 
 (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 ===
 
 (def timestamp-fmt "yyyyMMdd_hhmmss")

;; lein commands?  Separate lein plugins?
(def sub-commands
  {"build-deps" build-deps
   "freshen" nope
   "task-add" nope
   "new-task" nope})


    (dorun (map #(.setLevel ^Handler %1 %2) handlers old-levels))
    result))

(defn find-project-files
  [^File d]
  (let [{:keys [out err exit]} (git d "ls-files" "project.clj" "**/project.clj")
