summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2015-11-03 13:48:57 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2015-11-03 13:48:57 +0100
commit2674a14becba89bb6b5259cd0ff3e5b29b724325 (patch)
treee076fe55932b5a053f8f5858f5d824d6a06d2f4d /app/models
parent63cafdb8e5f9481539beaf2b6eac11cf8148daf1 (diff)
parent86c0d8d28983c4f6abbcbf461e422b2fe5962847 (diff)
downloadgitlab-ce-2674a14becba89bb6b5259cd0ff3e5b29b724325.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into spread-runner-last-updated-atspread-runner-last-updated-at
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/commit.rb2
-rw-r--r--app/models/repository.rb9
2 files changed, 10 insertions, 1 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb
index 13437b2483f..e58420d82d4 100644
--- a/app/models/ci/commit.rb
+++ b/app/models/ci/commit.rb
@@ -187,7 +187,7 @@ module Ci
end
def config_processor
- @config_processor ||= Ci::GitlabCiYamlProcessor.new(ci_yaml_file)
+ @config_processor ||= Ci::GitlabCiYamlProcessor.new(ci_yaml_file, gl_project.path_with_namespace)
rescue Ci::GitlabCiYamlProcessor::ValidationError => e
save_yaml_error(e.message)
nil
diff --git a/app/models/repository.rb b/app/models/repository.rb
index c9b36bd8170..9266ba27f0a 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -87,6 +87,15 @@ class Repository
commits
end
+ def find_commits_by_message(query)
+ # Limited to 1000 commits for now, could be parameterized?
+ args = %W(git log --pretty=%H --max-count 1000 --grep=#{query})
+
+ git_log_results = Gitlab::Popen.popen(args, path_to_repo).first.lines.map(&:chomp)
+ commits = git_log_results.map { |c| commit(c) }
+ commits
+ end
+
def find_branch(name)
branches.find { |branch| branch.name == name }
end