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 ...@@ -425,8 +425,8 @@ class Project < ActiveRecord::Base
container_registry_repository.tags.any? container_registry_repository.tags.any?
end end
def commit(id = 'HEAD') def commit(ref = 'HEAD')
repository.commit(id) repository.commit(ref)
end end
def merge_base_commit(first_commit_id, second_commit_id) def merge_base_commit(first_commit_id, second_commit_id)
......
...@@ -78,9 +78,9 @@ class Repository ...@@ -78,9 +78,9 @@ class Repository
end end
end end
def commit(id = 'HEAD') def commit(ref = 'HEAD')
return nil unless exists? 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 = ::Commit.new(commit, @project) if commit
commit commit
rescue Rugged::OdbError 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