diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-01-05 02:53:45 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-01-05 02:53:45 +0800 |
commit | e01c692a35d817c09416356b549f473f63d78dc8 (patch) | |
tree | 188eec336302d0aa314f19817ddd793df7a61950 /app/services/git_operation_service.rb | |
parent | 99ac0935271b1e99f4512e496104219045f1018e (diff) | |
download | gitlab-ce-e01c692a35d817c09416356b549f473f63d78dc8.tar.gz |
Remove tag with git hooks
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, |