summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-03-19 10:34:04 +0100
committerDouwe Maan <douwe@gitlab.com>2015-03-19 10:34:04 +0100
commita5a5ec970e0e8dc56103decd3a0f5fbf3db46bcb (patch)
treeadb5d12a1e56b06f724782ff893d0bb1bb4864e1 /app
parent7ed6da5454c98e78770cee13ac929f5f608a34a1 (diff)
downloadgitlab-ce-a5a5ec970e0e8dc56103decd3a0f5fbf3db46bcb.tar.gz
Fewer constants, more helpers.
Diffstat (limited to 'app')
-rw-r--r--app/services/git_push_service.rb2
-rw-r--r--app/workers/irker_worker.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb
index 4885e1b2fc5..a0da07f5c90 100644
--- a/app/services/git_push_service.rb
+++ b/app/services/git_push_service.rb
@@ -109,7 +109,7 @@ class GitPushService
def push_to_existing_branch?(ref, oldrev)
# Return if this is not a push to a branch (e.g. new commits)
- Gitlab::Git.branch_ref?(ref) && oldrev != Gitlab::Git::BLANK_SHA
+ Gitlab::Git.branch_ref?(ref) && !Gitlab::Git.blank_ref?(oldrev)
end
def push_to_new_branch?(ref, oldrev)
diff --git a/app/workers/irker_worker.rb b/app/workers/irker_worker.rb
index e1a99d9cad8..8b50f423984 100644
--- a/app/workers/irker_worker.rb
+++ b/app/workers/irker_worker.rb
@@ -57,9 +57,9 @@ class IrkerWorker
end
def send_branch_updates(push_data, project, repo_name, committer, branch)
- if push_data['before'] == Gitlab::Git::BLANK_SHA
+ if Gitlab::Git.blank_ref?(push_data['before'])
send_new_branch project, repo_name, committer, branch
- elsif push_data['after'] == Gitlab::Git::BLANK_SHA
+ elsif Gitlab::Git.blank_ref?(push_data['after'])
send_del_branch repo_name, committer, branch
end
end
@@ -83,7 +83,7 @@ class IrkerWorker
return if push_data['total_commits_count'] == 0
# Next message is for number of commit pushed, if any
- if push_data['before'] == Gitlab::Git::BLANK_SHA
+ if Gitlab::Git.blank_ref?(push_data['before'])
# Tweak on push_data["before"] in order to have a nice compare URL
push_data['before'] = before_on_new_branch push_data, project
end