Sha256: 8a429fa89c66bb4a227282d742085e2e21396c046d5b3f1ec64b86b8967ec04a
Contents?: true
Size: 646 Bytes
Versions: 13
Compression:
Stored size: 646 Bytes
Contents
module Gitlab module Git class Ref # Branch or tag name # without "refs/tags|heads" prefix attr_reader :name # Target sha. # Usually it is commit sha but in case # when tag reference on other tag it can be tag sha attr_reader :target # Extract branch name from full ref path # # Ex. # Ref.extract_branch_name('refs/heads/master') #=> 'master' def self.extract_branch_name(str) str.gsub(/\Arefs\/heads\//, '') end def initialize(name, target) @name, @target = name.gsub(/\Arefs\/(tags|heads)\//, ''), target end end end end
Version data entries
13 entries across 13 versions & 1 rubygems