tomdoc reorg for git_access.rb

This commit is contained in:
rick
2010-11-20 14:14:41 -08:00
parent 4dda9fb2ae
commit db2a6deca9
2 changed files with 34 additions and 24 deletions
+30 -24
View File
@@ -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" => [<BlobEntry>, <BlobEntry>]}
#
attr_reader :tree_map
# Gets a Hash cache of commit SHAs to the Grit::Commit instance.
#
# {"abcd123" => <Grit::Commit>}
#
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" => [<BlobEntry>, <BlobEntry>]}
#
attr_reader :tree_map
# Gets a Hash cache of commit SHAs to the Grit::Commit instance.
#
# {"abcd123" => <Grit::Commit>}
#
attr_reader :commit_map
# Raw method for fetching a list of Git commits.
#
# shas - An Array of String SHAs.
+4
View File
@@ -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