lib/gitlab_git/diff.rb in gitlab_git-2.1.1 vs lib/gitlab_git/diff.rb in gitlab_git-2.2.0
- old
+ new
@@ -13,16 +13,16 @@
# Stats properties
attr_accessor :new_file, :renamed_file, :deleted_file
class << self
- def between(repo, from, to)
+ def between(repo, head, base)
# Only show what is new in the source branch compared to the target branch, not the other way around.
# The linex below with merge_base is equivalent to diff with three dots (git diff branch1...branch2)
# From the git documentation: "git diff A...B" is equivalent to "git diff $(git-merge-base A B) B"
- common_commit = repo.merge_base_commit(from, to)
+ common_commit = repo.merge_base_commit(head, base)
- repo.diff(common_commit, from).map do |diff|
+ repo.diff(common_commit, head).map do |diff|
Gitlab::Git::Diff.new(diff)
end
rescue Grit::Git::GitTimeout
[Gitlab::Git::Diff::BROKEN_DIFF]
end