Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement visitFileFailed for mkvisitor #598

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions boot/pod/src/boot/tmpdir.clj
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@
(add-blob! blob path i link)
(swap! tree assoc p (map->TmpFile (assoc m :path p :id i :hash h :time t))))
(catch java.nio.file.NoSuchFileException _
(util/dbug* "Tmpdir: file not found: %s\n" (.toString p))))) )))))
(util/dbug* "Tmpdir: file not found: %s\n" (.toString p)))))))
(visitFileFailed [^Path path ^java.io.IOException e]
(with-let [_ fs/skip-subtree]
(let [p (str (.relativize root path))]
(util/dbug* "Tmpdir: failed to visit: %s\n" (.toString p))))))))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor thing: Now that .relativize call is outside of the dbug* macro call, it is evaluated always. If it was inside the macro call, if would be evaluated only when dbug output is enabled.

Also, it is unnecessary to have both str and .toString calls.


(defn- dir->tree!
[^File dir ^File blob]
Expand Down Expand Up @@ -263,7 +267,7 @@
err? (fatal-conflict? dst)
this (or (and (not err?) this)
(update-in this [:tree] dissoc p))]
(if err?
(if err?
(util/warn "Merge conflict: not adding %s\n" p)
(do (util/trace* "Commit: adding %s %s...\n" (id tmpf) p)
(file/hard-link src dst)))
Expand Down