Gollum::Page#versions sets :follow to false by default, and skips pagination options.
This commit is contained in:
+4
-4
@@ -151,18 +151,18 @@ module Gollum
|
|||||||
# :page - The Integer page number (default: 1).
|
# :page - The Integer page number (default: 1).
|
||||||
# :per_page - The Integer max count of items to return.
|
# :per_page - The Integer max count of items to return.
|
||||||
# :follow - Follow's a file across renames, but falls back
|
# :follow - Follow's a file across renames, but falls back
|
||||||
# to a slower Grit native call. (default: true)
|
# to a slower Grit native call. (default: false)
|
||||||
#
|
#
|
||||||
# Returns an Array of Grit::Commit.
|
# Returns an Array of Grit::Commit.
|
||||||
def versions(options = {})
|
def versions(options = {})
|
||||||
options[:follow] = true if !options.key?(:follow)
|
|
||||||
options = log_pagination_options(options)
|
|
||||||
if options[:follow]
|
if options[:follow]
|
||||||
options[:pretty] = 'raw'
|
options[:pretty] = 'raw'
|
||||||
|
options.delete :max_count
|
||||||
|
options.delete :skip
|
||||||
log = @wiki.repo.git.native "log", options, "master", "--", @path
|
log = @wiki.repo.git.native "log", options, "master", "--", @path
|
||||||
Grit::Commit.list_from_string(@wiki.repo, log)
|
Grit::Commit.list_from_string(@wiki.repo, log)
|
||||||
else
|
else
|
||||||
@wiki.repo.log('master', @path, options)
|
@wiki.repo.log('master', @path, log_pagination_options(options))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -39,7 +39,7 @@ context "Page" do
|
|||||||
test "page versions across renames" do
|
test "page versions across renames" do
|
||||||
page = @wiki.page 'My-Precious'
|
page = @wiki.page 'My-Precious'
|
||||||
assert_equal ['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b', '94523d7ae48aeba575099dd12926420d8fd0425d'],
|
assert_equal ['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b', '94523d7ae48aeba575099dd12926420d8fd0425d'],
|
||||||
page.versions.map { |v| v.id }
|
page.versions(:follow => true).map { |v| v.id }
|
||||||
end
|
end
|
||||||
|
|
||||||
test "page versions without renames" do
|
test "page versions without renames" do
|
||||||
|
|||||||
Reference in New Issue
Block a user