Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-03-10 13:51:36 +0300
committerDouwe Maan <douwe@gitlab.com>2015-03-10 15:39:31 +0300
commit383c56efa1882d9cab956de5b5b72e51691c3f0c (patch)
tree1eebe2c35351d44a9fa54f53658346f86d9566a3 /app/services/event_create_service.rb
parente0caed91e2cd6b959f808139df7c40f3644f88fd (diff)
Use Gitlab::Git helper methods and constants as much as possible.
Diffstat (limited to 'app/services/event_create_service.rb')
-rw-r--r--app/services/event_create_service.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/services/event_create_service.rb b/app/services/event_create_service.rb
index ba9547b9242..dc52d6d89df 100644
--- a/app/services/event_create_service.rb
+++ b/app/services/event_create_service.rb
@@ -62,19 +62,19 @@ class EventCreateService
create_event(project, current_user, Event::CREATED)
end
- def push_ref(project, current_user, ref, action = 'add', prefix = 'refs/heads')
+ def push_ref(project, current_user, ref, action = 'add', prefix = Gitlab::Git::BRANCH_REF_PREFIX)
commit = project.repository.commit(ref.target)
if action.to_s == 'add'
- before = '00000000'
+ before = Gitlab::Git::BLANK_SHA
after = commit.id
else
before = commit.id
- after = '00000000'
+ after = Gitlab::Git::BLANK_SHA
end
data = {
- ref: "#{prefix}/#{ref.name}",
+ ref: "#{prefix}#{ref.name}",
before: before,
after: after
}