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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-23 21:07:55 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-23 21:07:55 +0300
commit5421d61b1d5ffe11a9c7afbe2259b4e4d0e7c993 (patch)
tree093cfd5a5f80119f6e9c7ccd2c646ca2482cc3d2 /lib/gitlab/gitaly_client
parentbc0f141f2f073a971aad1eb5349bb718747df028 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/gitaly_client')
-rw-r--r--lib/gitlab/gitaly_client/ref_service.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/gitaly_client/ref_service.rb b/lib/gitlab/gitaly_client/ref_service.rb
index de76ade76cb..3ab596da529 100644
--- a/lib/gitlab/gitaly_client/ref_service.rb
+++ b/lib/gitlab/gitaly_client/ref_service.rb
@@ -17,6 +17,8 @@ module Gitlab
'desc' => Gitaly::SortDirection::DESCENDING
}.freeze
+ AMBIGUOUS_REFERENCE = 'reference is ambiguous'
+
# 'repository' is a Gitlab::Git::Repository
def initialize(repository)
@repository = repository
@@ -109,6 +111,10 @@ module Gitlab
target_commit = Gitlab::Git::Commit.decorate(@repository, branch.target_commit)
Gitlab::Git::Branch.new(@repository, branch.name.dup, branch.target_commit.id, target_commit)
+ rescue GRPC::BadStatus => e
+ raise e unless e.message.include?(AMBIGUOUS_REFERENCE)
+
+ raise Gitlab::Git::AmbiguousRef, "branch is ambiguous: #{branch_name}"
end
def find_tag(tag_name)