Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwinniehell <git@winniehell.de>2016-08-24 03:22:30 +0300
committerwinniehell <git@winniehell.de>2016-08-24 13:54:16 +0300
commitddbdf4e609c70dc6ed88860b5e1e65abde69ee94 (patch)
tree824e93bbf35ee95020caeb5e316758b9aa361acb /lib/extracts_path.rb
parent75d48ae35bcdb8bfc0a6f661de32718710082856 (diff)
Restore get_id in ExtractsPath
Diffstat (limited to 'lib/extracts_path.rb')
-rw-r--r--lib/extracts_path.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb
index a293fa2752f..a4558d157c0 100644
--- a/lib/extracts_path.rb
+++ b/lib/extracts_path.rb
@@ -94,9 +94,7 @@ module ExtractsPath
@options = params.select {|key, value| allowed_options.include?(key) && !value.blank? }
@options = HashWithIndifferentAccess.new(@options)
- @id = params[:id] || params[:ref]
- @id += "/" + params[:path] unless params[:path].blank?
-
+ @id = get_id
@ref, @path = extract_ref(@id)
@repo = @project.repository
if @options[:extended_sha1].blank?
@@ -118,4 +116,13 @@ module ExtractsPath
def tree
@tree ||= @repo.tree(@commit.id, @path)
end
+
+ private
+
+ # overriden in subclasses, do not remove
+ def get_id
+ id = params[:id] || params[:ref]
+ id += "/" + params[:path] unless params[:path].blank?
+ id
+ end
end