Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJacob Vosmaer (GitLab) <jacob@gitlab.com>2018-07-19 20:48:58 +0300
committerRémy Coutable <remy@rymai.me>2018-07-19 20:48:58 +0300
commit805de7fb8d35a4bebb2f49f97584fe05a8bdd25a (patch)
treefb9a6ab224fbb3eccbbc733074aee46385ba686d /lib
parentbe2410ab18136df8ffc81d667879b4fefa61b732 (diff)
Add missing Gitaly branch_update nil checks
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/git/operation_service.rb2
-rw-r--r--lib/gitlab/gitaly_client/operation_service.rb11
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/gitlab/git/operation_service.rb b/lib/gitlab/git/operation_service.rb
index 280def182d5..57d748343be 100644
--- a/lib/gitlab/git/operation_service.rb
+++ b/lib/gitlab/git/operation_service.rb
@@ -8,6 +8,8 @@ module Gitlab
alias_method :branch_created?, :branch_created
def self.from_gitaly(branch_update)
+ return if branch_update.nil?
+
new(
branch_update.commit_id,
branch_update.repo_created,
diff --git a/lib/gitlab/gitaly_client/operation_service.rb b/lib/gitlab/gitaly_client/operation_service.rb
index 555733d1834..54c78fdb680 100644
--- a/lib/gitlab/gitaly_client/operation_service.rb
+++ b/lib/gitlab/gitaly_client/operation_service.rb
@@ -144,13 +144,14 @@ module Gitlab
branch: encode_binary(target_branch)
)
- branch_update = GitalyClient.call(
+ response = GitalyClient.call(
@repository.storage,
:operation_service,
:user_ff_branch,
request
- ).branch_update
- Gitlab::Git::OperationService::BranchUpdate.from_gitaly(branch_update)
+ )
+
+ Gitlab::Git::OperationService::BranchUpdate.from_gitaly(response.branch_update)
rescue GRPC::FailedPrecondition => e
raise Gitlab::Git::CommitError, e
end
@@ -306,9 +307,9 @@ module Gitlab
raise Gitlab::Git::CommitError, response.commit_error
elsif response.create_tree_error.presence
raise Gitlab::Git::Repository::CreateTreeError, response.create_tree_error
- else
- Gitlab::Git::OperationService::BranchUpdate.from_gitaly(response.branch_update)
end
+
+ Gitlab::Git::OperationService::BranchUpdate.from_gitaly(response.branch_update)
end
def user_commit_files_request_header(