in lib/rugged_adapter/git_layer_rugged.rb [625:634]
def update_ref(ref, commit_sha)
ref = "refs/heads/#{ref}" unless ref =~ /^refs\/heads\//
if _ref = @repo.references[ref]
@repo.references.update(_ref, commit_sha)
else
@repo.create_branch(ref, commit_sha)
@repo.checkout(ref, :strategy => :force) unless @repo.bare?
end
end