summaryrefslogtreecommitdiff
path: root/app/models/repository.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r--app/models/repository.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 112ad05c188..a0f2b3fb765 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -91,12 +91,9 @@ class Repository
# 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)
-
- # 1. Get result, which is 1-element array
- # 2. Split on lines
- # 3. Recreate array, but remove trailing newline characters on each element
- git_log_results.first.lines.map{ |l| l.chomp }
+ git_log_results = Gitlab::Popen.popen(args, path_to_repo).first.lines.map{ |l| l.chomp }
+ commits = git_log_results.map{ |c| commit(c) }
+ commits
end
def find_branch(name)