summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-07-07 22:47:38 +0000
committerDouwe Maan <douwe@gitlab.com>2016-07-07 22:47:38 +0000
commit5d3a0d38cb7311a71433ddad2126a1eeddc5b31a (patch)
treee7fe03537bcbf682cfb65381ab4c21f40ae729fa
parentdad406da23f7a4d94f9f8df1a4b8743dc0e9dc96 (diff)
parent93dd8b0a088b51874c45bb69a5255529f7e37dd5 (diff)
downloadgitlab-ce-5d3a0d38cb7311a71433ddad2126a1eeddc5b31a.tar.gz
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
-rw-r--r--app/models/project.rb4
-rw-r--r--app/models/repository.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 5005ee7cd32..a66b750cd48 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -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)
diff --git a/app/models/repository.rb b/app/models/repository.rb
index ba66bc47c29..5b670cb4b8f 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