diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-12-11 19:57:04 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-12-11 20:02:32 +0300 |
commit | c9ac38a074423b30b5627553bfdbf0ba15737d8e (patch) | |
tree | 707d4326200cbdb6c93b5647e55351582bceda85 /app | |
parent | 1c0683da7b593bb12e37d46e89a0764a93a0da95 (diff) |
Use Gitlab::Git instead of Ci::Git
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/commit.rb | 2 | ||||
-rw-r--r-- | app/services/create_commit_builds_service.rb | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 79193344545..d2a29236942 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -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 diff --git a/app/services/create_commit_builds_service.rb b/app/services/create_commit_builds_service.rb index 392fe21eecf..759c334ebe9 100644 --- a/app/services/create_commit_builds_service.rb +++ b/app/services/create_commit_builds_service.rb @@ -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! |