Commit 5d3a0d38 authored by Douwe Maan's avatar Douwe Maan

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
parents dad406da 93dd8b0a
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment