GitAccess#ref_to_sha should never return a blank string
This commit is contained in:
@@ -28,13 +28,17 @@ module Gollum
|
|||||||
#
|
#
|
||||||
# ref - a String Git reference (ex: "master")
|
# ref - a String Git reference (ex: "master")
|
||||||
#
|
#
|
||||||
# Returns a String.
|
# Returns a String, or nil if the ref isn't found.
|
||||||
def ref_to_sha(ref)
|
def ref_to_sha(ref)
|
||||||
if sha?(ref)
|
ref = ref.to_s
|
||||||
ref
|
return if ref.empty?
|
||||||
else
|
sha =
|
||||||
get_cache(:ref, ref) { ref_to_sha!(ref) }
|
if sha?(ref)
|
||||||
end
|
ref
|
||||||
|
else
|
||||||
|
get_cache(:ref, ref) { ref_to_sha!(ref) }
|
||||||
|
end.to_s
|
||||||
|
sha.empty? ? nil : sha
|
||||||
end
|
end
|
||||||
|
|
||||||
# Public: Gets a recursive list of Git blobs for the whole tree at the
|
# Public: Gets a recursive list of Git blobs for the whole tree at the
|
||||||
|
|||||||
Reference in New Issue
Block a user