diff options
Diffstat (limited to 'app/services/git_operation_service.rb')
-rw-r--r-- | app/services/git_operation_service.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/services/git_operation_service.rb b/app/services/git_operation_service.rb index ed9822cfee6..3b7f702e3ab 100644 --- a/app/services/git_operation_service.rb +++ b/app/services/git_operation_service.rb @@ -15,7 +15,7 @@ class GitOperationService def rm_branch(branch) ref = Gitlab::Git::BRANCH_REF_PREFIX + branch.name - oldrev = branch.dereferenced_target.id + oldrev = branch.target newrev = Gitlab::Git::BLANK_SHA update_ref_in_hooks(ref, newrev, oldrev) @@ -36,6 +36,16 @@ class GitOperationService end end + def rm_tag(tag) + ref = Gitlab::Git::TAG_REF_PREFIX + tag.name + oldrev = tag.target + newrev = Gitlab::Git::BLANK_SHA + + update_ref_in_hooks(ref, newrev, oldrev) do + repository.rugged.tags.delete(tag_name) + end + end + # Whenever `source_branch_name` is passed, if `branch_name` doesn't exist, # it would be created from `source_branch_name`. # If `source_project` is passed, and the branch doesn't exist, |