Fixed invalid commit show if git history broken

This commit is contained in:
Dmitriy Zaporozhets 2012-03-07 00:15:43 -08:00
parent 94befdd502
commit 57ce7124fc

View file

@ -260,7 +260,7 @@ class Project < ActiveRecord::Base
def commit(commit_id = nil)
commit = if commit_id
repo.commits(commit_id).first
repo.commit(commit_id)
else
repo.commits.first
end