diff --git a/lib/gollum/git_access.rb b/lib/gollum/git_access.rb index 76568f73..9306c893 100644 --- a/lib/gollum/git_access.rb +++ b/lib/gollum/git_access.rb @@ -2,30 +2,6 @@ module Gollum # Controls all access to the Git objects from Gollum. Extend this class to # add custom caching for special cases. class GitAccess - # Gets the String path to the Git repository. - attr_reader :path - - # Gets the Grit::Repo instance for the Git repository. - attr_reader :repo - - # Gets a Hash cache of refs to commit SHAs. - # - # {"master" => "abc123", ...} - # - attr_reader :ref_map - - # Gets a Hash cache of commit SHAs to a recursive tree of blobs. - # - # {"abc123" => [, ]} - # - attr_reader :tree_map - - # Gets a Hash cache of commit SHAs to the Grit::Commit instance. - # - # {"abcd123" => } - # - attr_reader :commit_map - def initialize(path) @path = path @repo = Grit::Repo.new(path) @@ -130,6 +106,36 @@ module Gollum @ref_map.clear end + ######################################################################### + # + # Internal Methods + # + ######################################################################### + + # Gets the String path to the Git repository. + attr_reader :path + + # Gets the Grit::Repo instance for the Git repository. + attr_reader :repo + + # Gets a Hash cache of refs to commit SHAs. + # + # {"master" => "abc123", ...} + # + attr_reader :ref_map + + # Gets a Hash cache of commit SHAs to a recursive tree of blobs. + # + # {"abc123" => [, ]} + # + attr_reader :tree_map + + # Gets a Hash cache of commit SHAs to the Grit::Commit instance. + # + # {"abcd123" => } + # + attr_reader :commit_map + # Raw method for fetching a list of Git commits. # # shas - An Array of String SHAs. diff --git a/lib/gollum/wiki.rb b/lib/gollum/wiki.rb index 249dee12..e94c5087 100644 --- a/lib/gollum/wiki.rb +++ b/lib/gollum/wiki.rb @@ -326,6 +326,10 @@ module Gollum @repo.log('master', nil, log_pagination_options(options)) end + # Public: Refreshes just the cached Git reference data. This should + # be called after every Gollum update. + # + # Returns nothing. def clear_cache @access.refresh end