diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-11-15 22:54:21 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-12-08 19:28:34 +0100 |
commit | 855e7c32b9f3541fec085726d338802c8ca9b9f4 (patch) | |
tree | 83794f5482e6b36e1f779788eb2d2c0fc24e51c0 /lib | |
parent | ce14c20a82af697b927666123443a25f19dab2ae (diff) | |
download | gitlab-ce-855e7c32b9f3541fec085726d338802c8ca9b9f4.tar.gz |
Use Gitlab::Git::Ref in Project#resolve_ref
Reworks Project#resolve_ref to return Gitlab::Git::Branch,
Gitlab::Git::Tag or raise an AmbiguousRef error.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/git/branch.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/git/ref.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/git/tag.rb | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/lib/gitlab/git/branch.rb b/lib/gitlab/git/branch.rb index 9447cfa0fb6..d25eebd5f47 100644 --- a/lib/gitlab/git/branch.rb +++ b/lib/gitlab/git/branch.rb @@ -28,6 +28,10 @@ module Gitlab def state active? ? :active : :stale end + + def full_ref + Gitlab::Git::BRANCH_REF_PREFIX + name + end end end end diff --git a/lib/gitlab/git/ref.rb b/lib/gitlab/git/ref.rb index eec91194949..b9c8b7c08e9 100644 --- a/lib/gitlab/git/ref.rb +++ b/lib/gitlab/git/ref.rb @@ -39,6 +39,10 @@ module Gitlab nil end end + + def full_ref + raise NotImplementedError + end end end end diff --git a/lib/gitlab/git/tag.rb b/lib/gitlab/git/tag.rb index 23d989ff258..ec89bc4f7e6 100644 --- a/lib/gitlab/git/tag.rb +++ b/lib/gitlab/git/tag.rb @@ -62,6 +62,10 @@ module Gitlab encode! @message end + def full_ref + Gitlab::Git::TAG_REF_PREFIX + name + end + private def message_from_gitaly_tag |