diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2017-09-25 23:01:04 +0300 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2017-09-29 01:53:49 +0300 |
commit | 4f5be9ec7bfd4813eaac630c9232cd5335a5076b (patch) | |
tree | a9ecb86a82296b7fbfa17dbb2ed36b30e4fcf165 /lib/gitlab/gitaly_client/util.rb | |
parent | 07c3112ef540a78c4a84281368eb975ba27a1f4c (diff) |
Migrate Gitlab::Git::Repository#add_tag to Gitaly
Closes gitaly#601
Diffstat (limited to 'lib/gitlab/gitaly_client/util.rb')
-rw-r--r-- | lib/gitlab/gitaly_client/util.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/gitaly_client/util.rb b/lib/gitlab/gitaly_client/util.rb index 554166a8a9e..2fb5875a7a2 100644 --- a/lib/gitlab/gitaly_client/util.rb +++ b/lib/gitlab/gitaly_client/util.rb @@ -20,6 +20,20 @@ module Gitlab email: GitalyClient.encode(gitlab_user.email) ) end + + def gitlab_tag_from_gitaly_tag(repository, gitaly_tag) + if gitaly_tag.target_commit.present? + commit = Gitlab::Git::Commit.decorate(repository, gitaly_tag.target_commit) + end + + Gitlab::Git::Tag.new( + repository, + Gitlab::EncodingHelper.encode!(gitaly_tag.name.dup), + gitaly_tag.id, + commit, + Gitlab::EncodingHelper.encode!(gitaly_tag.message.chomp) + ) + end end end end |