diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-01-30 09:59:45 +0100 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-02-01 13:00:33 +0100 |
commit | 0a47d1924d6b283a174672f33cf7a0de6b281fef (patch) | |
tree | c11fce108b9fed69fd1c6749eff795e83af19afe /lib/gitlab/git/tag.rb | |
parent | 498d32363aa61d679ff749be727a6591257afb6d (diff) | |
download | gitlab-ce-0a47d1924d6b283a174672f33cf7a0de6b281fef.tar.gz |
Client changes for Tag,BranchNamesContainingCommit
As part of gitlab-org/gitaly#884, this commit contains the client
implementation for both TagNamesContaintingCommit and
BranchNamesContainingCommit. The interface in the Repository model stays
the same, but the implementation on the serverside, e.g. Gitaly, uses
`for-each-ref`, as opposed to `branch` or `tag` which both aren't
plumbing command. The result stays the same.
On the serverside, we have the opportunity to limit the number of names
to return. However, this is not supported on the front end yet. My
proposal to use this ability: gitlab-org/gitlab-ce#42581. For now, this
ability is not used as that would change more behaviours on a feature
flag which might lead to unexpected changes on page refresh for example.
Diffstat (limited to 'lib/gitlab/git/tag.rb')
-rw-r--r-- | lib/gitlab/git/tag.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/git/tag.rb b/lib/gitlab/git/tag.rb index bc4e160dce9..c163d383eb0 100644 --- a/lib/gitlab/git/tag.rb +++ b/lib/gitlab/git/tag.rb @@ -1,8 +1,12 @@ -# Gitaly note: JV: no RPC's here. -# module Gitlab module Git class Tag < Ref + class << self + def names_contains_sha(repo, sha) + GitalyClient::RefService.new(repo).branch_names_contains_sha(sha) + end + end + attr_reader :object_sha def initialize(repository, name, target, target_commit, message = nil) |