[refs #90] possible fix for nil commom ancestor commit

This commit is contained in:
Alexander Machehin 2012-10-01 23:52:18 +06:00
parent f92f209323
commit 8f011316c3
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@ class PullRequest < ActiveRecord::Base
repo = Grit::Repo.new(path)
base_commit = repo.commits(base_ref).first
head_commit = repo.commits(head_branch).first
@common_ancestor = repo.commit(repo.git.merge_base({}, base_commit, head_commit))
@common_ancestor = repo.commit(repo.git.merge_base({}, base_commit, head_commit)) || base_commit
end
def diff_stats(repo, a,b)