don't modify path names in cached wiki treemaps
This commit is contained in:
+1
-1
@@ -49,7 +49,7 @@ module Gollum
|
||||
checked = name.downcase
|
||||
map = @wiki.tree_map_for(version)
|
||||
sha = @wiki.ref_map[version] || version
|
||||
if pair = map.detect { |(path, _)| path == checked }
|
||||
if pair = map.detect { |(path, _)| path.downcase == checked }
|
||||
@path = name
|
||||
@blob = Grit::Blob.create(@wiki.repo, :id => pair.last, :name => ::File.basename(@path))
|
||||
@version = Grit::Commit.create(@wiki.repo, :id => sha)
|
||||
|
||||
@@ -418,7 +418,6 @@ module Gollum
|
||||
path.gsub!(/\\\d{3}/) { |m| m[1..-1].to_i(8).chr }
|
||||
end
|
||||
path.gsub!(/\\[rn"\\]/) { |m| eval(%("#{m.to_s}")) }
|
||||
path.downcase!
|
||||
path
|
||||
end
|
||||
|
||||
|
||||
+2
-2
@@ -59,14 +59,14 @@ context "Wiki" do
|
||||
assert @wiki.tree_map.empty?
|
||||
@wiki.tree_map_for 'master'
|
||||
assert_equal({"master"=>"60f12f4254f58801b9ee7db7bca5fa8aeefaa56b"}, @wiki.ref_map)
|
||||
assert_equal 'bilbo-baggins.md', @wiki.tree_map['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b'][0][0]
|
||||
assert_equal 'Bilbo-Baggins.md', @wiki.tree_map['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b'][0][0]
|
||||
end
|
||||
|
||||
test "#tree_map_for only caches tree for commit" do
|
||||
assert @wiki.tree_map.empty?
|
||||
@wiki.tree_map_for '60f12f4254f58801b9ee7db7bca5fa8aeefaa56b'
|
||||
assert @wiki.ref_map.empty?
|
||||
assert_equal 'bilbo-baggins.md', @wiki.tree_map['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b'][0][0]
|
||||
assert_equal 'Bilbo-Baggins.md', @wiki.tree_map['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b'][0][0]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user