Skip to content

Commit

Permalink
Revert "Warn when merging a file with a directory of the same name"
Browse files Browse the repository at this point in the history
This reverts commit 9443143.
  • Loading branch information
micha committed Dec 19, 2015
1 parent 469a387 commit 5a2e91d
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions boot/pod/src/boot/tmpdir.clj
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,15 @@

(defn- apply-mergers!
[mergers ^File old-file path ^File new-file ^File merged-file]
(if (some (memfn isDirectory) [old-file new-file])
(util/warn "Can't merge: entry is both file and directory: %s" path)
(when-let [merger (some (fn [[re v]] (when (re-find re path) v)) mergers)]
(util/dbug "Merging duplicate entry (%s)\n" path)
(let [out-file (File/createTempFile (.getName merged-file) nil
(.getParentFile merged-file))]
(with-open [curr-stream (io/input-stream old-file)
new-stream (io/input-stream new-file)
out-stream (io/output-stream out-file)]
(merger curr-stream new-stream out-stream))
(file/move out-file merged-file)))))
(when-let [merger (some (fn [[re v]] (when (re-find re path) v)) mergers)]
(util/dbug "Merging duplicate entry (%s)\n" path)
(let [out-file (File/createTempFile (.getName merged-file) nil
(.getParentFile merged-file))]
(with-open [curr-stream (io/input-stream old-file)
new-stream (io/input-stream new-file)
out-stream (io/output-stream out-file)]
(merger curr-stream new-stream out-stream))
(file/move out-file merged-file))))

(defn- set-dir
[tree dir]
Expand Down

0 comments on commit 5a2e91d

Please sign in to comment.