integrate Gollum::GitAccess

This commit is contained in:
rick
2010-10-11 12:06:35 -07:00
parent 62c4b795be
commit ebf7855c09
6 changed files with 151 additions and 114 deletions
+7 -3
View File
@@ -6,10 +6,13 @@ module Gollum
# Gets the String full path for this blob.
attr_reader :path
def initialize(sha, path)
attr_reader :size
def initialize(sha, path, size = nil)
@sha = sha
@path = path
@dir = @name = @blob = nil
@size = size
@dir = @name = @blob = nil
end
# Gets the normalized directory path for this blob.
@@ -28,7 +31,8 @@ module Gollum
#
# Returns an unbaked Grit::Blob instance.
def blob(repo)
@blob ||= Grit::Blob.create(repo, :id => @sha, :name => @name)
@blob ||= Grit::Blob.create(repo,
:id => @sha, :name => name, :size => @size)
end
# Gets a Page instance for this blob.