diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-12-11 17:57:04 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-12-11 18:02:32 +0100 |
commit | c9ac38a074423b30b5627553bfdbf0ba15737d8e (patch) | |
tree | 707d4326200cbdb6c93b5647e55351582bceda85 | |
parent | 1c0683da7b593bb12e37d46e89a0764a93a0da95 (diff) | |
download | gitlab-ce-c9ac38a074423b30b5627553bfdbf0ba15737d8e.tar.gz |
Use Gitlab::Git instead of Ci::Git
-rw-r--r-- | app/models/ci/commit.rb | 2 | ||||
-rw-r--r-- | app/services/create_commit_builds_service.rb | 6 | ||||
-rw-r--r-- | lib/ci/git.rb | 5 |
3 files changed, 4 insertions, 9 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! diff --git a/lib/ci/git.rb b/lib/ci/git.rb deleted file mode 100644 index 7acc3f38edb..00000000000 --- a/lib/ci/git.rb +++ /dev/null @@ -1,5 +0,0 @@ -module Ci - module Git - BLANK_SHA = '0' * 40 - end -end |