Commit c9ac38a0 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Use Gitlab::Git instead of Ci::Git

parent 1c0683da
......@@ -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
......
......@@ -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!
......
module Ci
module Git
BLANK_SHA = '0' * 40
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment