111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
# File 'lib/metaverse/repo.rb', line 111
def load_state prefix, state, remote = nil, should_create_branch = false
ref_name = "refs/meta"
ref_name += remote.nil? ? "/local" : "/remotes/#{remote}"
ref_name += "/#{prefix}/#{state}"
if should_create_branch
branch_name = "#{prefix}/#{state}"
if @repo.branches[branch_name].nil?
puts "Creating branch #{branch_name} based on #{ref_name}"
@repo.create_branch branch_name, ref_name
end
return checkout branch_name
end
checkout ref_name
end
|