Use Gitlab::Git instead of Ci::Git

This commit is contained in:
Kamil Trzcinski 2015-12-11 17:57:04 +01:00
parent 1c0683da7b
commit c9ac38a074
3 changed files with 4 additions and 9 deletions

View File

@ -53,7 +53,7 @@ module Ci
end
def valid_commit_sha
if self.sha == Ci::Git::BLANK_SHA
if self.sha == Gitlab::Git::BLANK_SHA
self.errors.add(:sha, " cant be 00000000 (branch removal)")
end
end

View File

@ -9,14 +9,14 @@ class CreateCommitBuildsService
return false
end
ref = origin_ref.gsub(/\Arefs\/(tags|heads)\//, '')
ref = Gitlab::Git.ref_name(origin_ref)
# Skip branch removal
if sha == Ci::Git::BLANK_SHA
if sha == Gitlab::Git::BLANK_SHA
return false
end
tag = origin_ref.start_with?('refs/tags/')
tag = Gitlab::Git.tag_ref?(origin_ref)
commit = project.ensure_ci_commit(sha)
unless commit.skip_ci?
commit.update_committed!

View File

@ -1,5 +0,0 @@
module Ci
module Git
BLANK_SHA = '0' * 40
end
end