diff --git a/app/models/pull_request.rb b/app/models/pull_request.rb index a422b2f80..f162edefa 100644 --- a/app/models/pull_request.rb +++ b/app/models/pull_request.rb @@ -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)