                (add-git-facts gitdir))]
     (when (::dirty (meta db))
       (write-git-db db gitdir))
-    db))
+    (assoc db :gitdir gitdir)))
 
 (defn update-repo-dbs
   "Update voom dbs for all git repos in $VOOM_REPOS.

     :path found-path
     :proj proj-name
     :gitdir gitdir
     :branch found-branch}))

(defn help

              (sh "rm" "-rf" checkout))))

(defn box-repo-add
  [{:keys [repo gitdir branch sha proj path]}]
  (if-let [bdir (find-box)]
    (let [sha (str sha)
          pname (-> (str proj)
                    (s/replace #"/" "--"))
          pdir (adj-path bdir pname)
          checkout (adj-path bdir task-dir pname)
          g {:gitdir checkout}]
      (when (and (.exists ^File checkout)
                 (not= repo (-> (remotes (:gitdir g)) :origin :fetch)))
        (safe-delete-repo checkout pdir))
      (if (.exists ^File checkout)
        (git g "fetch")
        (git {} "clone" repo "--refer" gitdir checkout))
      (git g "checkout" sha) ; must detach head for update...
      (git g "branch" "-f" branch sha)
      (git g "checkout" branch)
