Also use ref in Repository#commit

This commit is contained in:
Lin Jen-Shin 2016-07-07 19:33:54 +08:00
parent 011e281604
commit 93dd8b0a08
1 changed files with 2 additions and 2 deletions

View File

@ -78,9 +78,9 @@ class Repository
end
end
def commit(id = 'HEAD')
def commit(ref = 'HEAD')
return nil unless exists?
commit = Gitlab::Git::Commit.find(raw_repository, id)
commit = Gitlab::Git::Commit.find(raw_repository, ref)
commit = ::Commit.new(commit, @project) if commit
commit
rescue Rugged::OdbError