summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-07-07 19:33:54 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-07-07 19:33:54 +0800
commit93dd8b0a088b51874c45bb69a5255529f7e37dd5 (patch)
tree11c5c6e36bd0bd8974f3a6ca1e5739a5dfd5a453
parent011e281604c3217591692bcfa20569eb6aef24cd (diff)
downloadgitlab-ce-93dd8b0a088b51874c45bb69a5255529f7e37dd5.tar.gz
Also use ref in Repository#commitprefer-ref
-rw-r--r--app/models/repository.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 078ca8f4e13..3b956a30a77 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -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