Skip to content

Commit

Permalink
prevent expanded paths from getting into the history cache
Browse files Browse the repository at this point in the history
  • Loading branch information
wlipa committed Sep 23, 2015
1 parent 509e9cb commit b843097
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/sprockets/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,10 @@ def fetch_asset_from_dependency_cache(unloaded, limit = 3)

history = cache.get(key) || []
history.each_with_index do |deps, index|
deps.map! { |path| path.start_with?("file-digest://") ? expand_from_root(path) : path }
if asset = yield(deps)
expanded_deps = deps.map do |path|
path.start_with?("file-digest://") ? expand_from_root(path) : path
end
if asset = yield(expanded_deps)
cache.set(key, history.rotate!(index)) if index > 0
return asset
end
Expand Down

0 comments on commit b843097

Please sign in to comment.