Sha256: 82e6b3ed9ccf7a1639f14258370d50318be9c4a49765e8ad7e914f32da3dcf91
Contents?: true
Size: 626 Bytes
Versions: 10
Compression:
Stored size: 626 Bytes
Contents
module GitObjectBrowser module Models class Ref def initialize(input) @content = input.read(nil) if @content =~ %r{\Aref:\s*(.+)} @ref = $1 elsif @content =~ %r{\A([0-9a-f]{40})} @sha1 = $1 end end def to_hash return { :ref => @ref, :sha1 => @sha1, :content => @content } end def self.path?(relpath) ref_names = %w{HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD CHERRY_PICK_HEAD} return (ref_names.include?(relpath) || relpath =~ %r{\Arefs/}) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems