Commit 597ea72a authored by Alejandro Rodríguez's avatar Alejandro Rodríguez

Fix Gitaly related conflicts

parent 41426268
......@@ -3,44 +3,8 @@
module Gitlab
module Git
class Branch < Ref
<<<<<<< HEAD
def initialize(repository, name, target)
if target.is_a?(Gitaly::FindLocalBranchResponse)
target = target_from_gitaly_local_branches_response(target)
end
super(repository, name, target)
end
def target_from_gitaly_local_branches_response(response)
# Git messages have no encoding enforcements. However, in the UI we only
# handle UTF-8, so basically we cross our fingers that the message force
# encoded to UTF-8 is readable.
message = response.commit_subject.dup.force_encoding('UTF-8')
# NOTE: For ease of parsing in Gitaly, we have only the subject of
# the commit and not the full message. This is ok, since all the
# code that uses `local_branches` only cares at most about the
# commit message.
# TODO: Once gitaly "takes over" Rugged consider separating the
# subject from the message to make it clearer when there's one
# available but not the other.
hash = {
id: response.commit_id,
message: message,
authored_date: Time.at(response.commit_author.date.seconds),
author_name: response.commit_author.name.dup,
author_email: response.commit_author.email.dup,
committed_date: Time.at(response.commit_committer.date.seconds),
committer_name: response.commit_committer.name.dup,
committer_email: response.commit_committer.email.dup
}
Gitlab::Git::Commit.decorate(hash)
=======
def initialize(repository, name, target, target_commit)
super(repository, name, target, target_commit)
>>>>>>> upstream/master
end
end
end
......
......@@ -808,19 +808,11 @@ module Gitlab
end
def gitaly_ref_client
<<<<<<< HEAD
@gitaly_ref_client ||= Gitlab::GitalyClient::Ref.new(self)
end
def gitaly_commit_client
@gitaly_commit_client ||= Gitlab::GitalyClient::Commit.new(self)
=======
@gitaly_ref_client ||= Gitlab::GitalyClient::RefService.new(self)
end
def gitaly_commit_client
@gitaly_commit_client ||= Gitlab::GitalyClient::CommitService.new(self)
>>>>>>> upstream/master
end
private
......
......@@ -72,12 +72,8 @@ module Gitlab
Gitlab::Git::Branch.new(
@repository,
encode!(gitaly_branch.name.dup),
<<<<<<< HEAD:lib/gitlab/gitaly_client/ref.rb
gitaly_branch
=======
gitaly_branch.commit_id,
commit_from_local_branches_response(gitaly_branch)
>>>>>>> upstream/master:lib/gitlab/gitaly_client/ref_service.rb
)
end
end
......
require 'spec_helper'
<<<<<<< HEAD:spec/lib/gitlab/gitaly_client/commit_spec.rb
describe Gitlab::GitalyClient::Commit do
=======
describe Gitlab::GitalyClient::CommitService do
>>>>>>> upstream/master:spec/lib/gitlab/gitaly_client/commit_service_spec.rb
let(:project) { create(:project, :repository) }
let(:repository) { project.repository }
let(:repository_message) { repository.gitaly_repository }
......
......@@ -120,15 +120,9 @@ describe GitPushService, services: true do
context "the commit" do
subject { push_data_from_service(project, user, oldrev, newrev, ref)[:commits].first }
<<<<<<< HEAD
it { is_expected.to include(id: commit.id) }
it { is_expected.to include(message: commit.safe_message) }
it { expect(subject[:timestamp].in_time_zone).to eq(commit.date.in_time_zone) }
=======
it { is_expected.to include(id: @commit.id) }
it { is_expected.to include(message: @commit.safe_message) }
it { expect(subject[:timestamp].in_time_zone).to eq(@commit.date.in_time_zone) }
>>>>>>> upstream/master
it do
is_expected.to include(
url: [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment