Skip to content

Commit

Permalink
Revert "Gollum::Wiki#pages come back sorted by title, not permalink o…
Browse files Browse the repository at this point in the history
…r the default ordering from `git ls-tree`."

This reverts commit e37a8b9.
  • Loading branch information
technoweenie committed Oct 6, 2010
1 parent 251d5c8 commit dd7dddd
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
4 changes: 1 addition & 3 deletions lib/gollum/wiki.rb
Expand Up @@ -221,9 +221,7 @@ def delete_page(page, commit)
#
# Returns an Array of Gollum::Page instances.
def pages(treeish = nil)
tree_list(treeish || 'master').sort! do |x, y|
x.title.downcase <=> y.title.downcase
end
tree_list(treeish || 'master')
end

# Public: Returns the number of pages accessible from a commit
Expand Down

This file was deleted.

Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion test/examples/lotr.git/refs/heads/master
@@ -1 +1 @@
308fdf72d89351bf53fa6eeb00884273047e07fa
60f12f4254f58801b9ee7db7bca5fa8aeefaa56b
16 changes: 8 additions & 8 deletions test/test_wiki.rb
Expand Up @@ -32,15 +32,15 @@
assert_equal commits, @wiki.log(:page => 2).map { |c| c.id }
end

test "list pages, sorted by title" do
test "list pages" do
pages = @wiki.pages
assert_equal \
%w(bilbo.md Bilbo-Baggins.md Eye-Of-Sauron.md My-Precious.md Home.textile),
pages.map { |p| p.filename }
%w(Bilbo-Baggins.md Eye-Of-Sauron.md Home.textile My-Precious.md),
pages.map { |p| p.filename }.sort
end

test "counts pages" do
assert_equal 5, @wiki.size
assert_equal 4, @wiki.size
end

test "normalizes commit hash" do
Expand All @@ -64,9 +64,9 @@
assert @wiki.ref_map.empty?
assert @wiki.tree_map.empty?
@wiki.tree_map_for 'master'
assert_equal({"master"=>"308fdf72d89351bf53fa6eeb00884273047e07fa"}, @wiki.ref_map)
assert_equal({"master"=>"60f12f4254f58801b9ee7db7bca5fa8aeefaa56b"}, @wiki.ref_map)

map = @wiki.tree_map['308fdf72d89351bf53fa6eeb00884273047e07fa']
map = @wiki.tree_map['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b']
assert_equal 'Bilbo-Baggins.md', map[0].path
assert_equal '', map[0].dir
assert_equal map[0].path, map[0].name
Expand All @@ -77,10 +77,10 @@

test "#tree_map_for only caches tree for commit" do
assert @wiki.tree_map.empty?
@wiki.tree_map_for '308fdf72d89351bf53fa6eeb00884273047e07fa'
@wiki.tree_map_for '60f12f4254f58801b9ee7db7bca5fa8aeefaa56b'
assert @wiki.ref_map.empty?

entry = @wiki.tree_map['308fdf72d89351bf53fa6eeb00884273047e07fa'][0]
entry = @wiki.tree_map['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b'][0]
assert_equal 'Bilbo-Baggins.md', entry.path
end
end
Expand Down

0 comments on commit dd7dddd

Please sign in to comment.