summaryrefslogtreecommitdiff
path: root/app/models/event.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-24 14:55:27 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-24 14:55:27 +0200
commit31386adf53e0a029167de3b73f3ebda93b0e86a2 (patch)
treea04fb5ea34479d2dfdf11f259c9af14082278d87 /app/models/event.rb
parent6c660698eba8d9c296adffcd09576949fc48f788 (diff)
downloadgitlab-ce-31386adf53e0a029167de3b73f3ebda93b0e86a2.tar.gz
Fixed 500 error on branch and tag creation via UI
Also fixes issue with branch/tag removing via UI Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models/event.rb')
-rw-r--r--app/models/event.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/event.rb b/app/models/event.rb
index ddb863c1be2..d43d6eb682f 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -56,11 +56,13 @@ class Event < ActiveRecord::Base
end
def create_ref_event(project, user, ref, action = 'add', prefix = 'refs/heads')
+ commit = project.repository.commit(ref.target)
+
if action.to_s == 'add'
before = '00000000'
- after = ref.commit.id
+ after = commit.id
else
- before = ref.commit.id
+ before = commit.id
after = '00000000'
end