summaryrefslogtreecommitdiff
path: root/app/models/event.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-03-10 11:51:36 +0100
committerDouwe Maan <douwe@gitlab.com>2015-03-10 13:39:31 +0100
commit383c56efa1882d9cab956de5b5b72e51691c3f0c (patch)
tree1eebe2c35351d44a9fa54f53658346f86d9566a3 /app/models/event.rb
parente0caed91e2cd6b959f808139df7c40f3644f88fd (diff)
downloadgitlab-ce-383c56efa1882d9cab956de5b5b72e51691c3f0c.tar.gz
Use Gitlab::Git helper methods and constants as much as possible.
Diffstat (limited to 'app/models/event.rb')
-rw-r--r--app/models/event.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/models/event.rb b/app/models/event.rb
index 5579ab1dbb0..8d20d7ef252 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -190,19 +190,19 @@ class Event < ActiveRecord::Base
end
def tag?
- data[:ref]["refs/tags"]
+ Gitlab::Git.tag_ref?(data[:ref])
end
def branch?
- data[:ref]["refs/heads"]
+ Gitlab::Git.branch_ref?(data[:ref])
end
def new_ref?
- commit_from =~ /^00000/
+ Gitlab::Git.blank_ref?(commit_from)
end
def rm_ref?
- commit_to =~ /^00000/
+ Gitlab::Git.blank_ref?(commit_to)
end
def md_ref?
@@ -226,11 +226,11 @@ class Event < ActiveRecord::Base
end
def branch_name
- @branch_name ||= data[:ref].gsub("refs/heads/", "")
+ @branch_name ||= Gitlab::Git.ref_name(data[:ref])
end
def tag_name
- @tag_name ||= data[:ref].gsub("refs/tags/", "")
+ @tag_name ||= Gitlab::Git.ref_name(data[:ref])
end
# Max 20 commits from push DESC