lib/gitlab_git/repository.rb in gitlab_git-7.0.0.rc2 vs lib/gitlab_git/repository.rb in gitlab_git-7.0.0.rc3
- old
+ new
@@ -196,11 +196,12 @@
default_options = {
limit: 10,
offset: 0,
path: nil,
ref: root_ref,
- follow: false
+ follow: false,
+ skip_merges: false
}
options = default_options.merge(options)
options[:limit] ||= 0
options[:offset] ||= 0
@@ -735,13 +736,19 @@
current_path = options[:path]
current_path = nil if current_path == ''
limit = options[:limit].to_i
offset = options[:offset].to_i
+ skip_merges = options[:skip_merges]
walker.sorting(Rugged::SORT_DATE)
walker.each do |c|
break if limit > 0 && commits.length >= limit
+
+ if skip_merges
+ # Skip merge commits
+ next if c.parents.length > 1
+ end
if !current_path ||
commit_touches_path?(c, current_path, options[:follow])
# This is a commit we care about, unless we haven't skipped enough