Merge branch 'prefer-ref' into 'master'
Prefer ref rather than id because id is shadowing database id ## What does this MR do? Just a local variable renaming. ## Why was this MR needed? Prefer ref rather than id because id is shadowing database id. See merge request !5134
This commit is contained in:
commit
5d3a0d38cb
2 changed files with 4 additions and 4 deletions
|
@ -425,8 +425,8 @@ class Project < ActiveRecord::Base
|
|||
container_registry_repository.tags.any?
|
||||
end
|
||||
|
||||
def commit(id = 'HEAD')
|
||||
repository.commit(id)
|
||||
def commit(ref = 'HEAD')
|
||||
repository.commit(ref)
|
||||
end
|
||||
|
||||
def merge_base_commit(first_commit_id, second_commit_id)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue