tomdoc reorg for git_access.rb
This commit is contained in:
+30
-24
@@ -2,30 +2,6 @@ module Gollum
|
|||||||
# Controls all access to the Git objects from Gollum. Extend this class to
|
# Controls all access to the Git objects from Gollum. Extend this class to
|
||||||
# add custom caching for special cases.
|
# add custom caching for special cases.
|
||||||
class GitAccess
|
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)
|
def initialize(path)
|
||||||
@path = path
|
@path = path
|
||||||
@repo = Grit::Repo.new(path)
|
@repo = Grit::Repo.new(path)
|
||||||
@@ -130,6 +106,36 @@ module Gollum
|
|||||||
@ref_map.clear
|
@ref_map.clear
|
||||||
end
|
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.
|
# Raw method for fetching a list of Git commits.
|
||||||
#
|
#
|
||||||
# shas - An Array of String SHAs.
|
# shas - An Array of String SHAs.
|
||||||
|
|||||||
@@ -326,6 +326,10 @@ module Gollum
|
|||||||
@repo.log('master', nil, log_pagination_options(options))
|
@repo.log('master', nil, log_pagination_options(options))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Public: Refreshes just the cached Git reference data. This should
|
||||||
|
# be called after every Gollum update.
|
||||||
|
#
|
||||||
|
# Returns nothing.
|
||||||
def clear_cache
|
def clear_cache
|
||||||
@access.refresh
|
@access.refresh
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user