summaryrefslogtreecommitdiff
path: root/lib/extracts_ref.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/extracts_ref.rb')
-rw-r--r--lib/extracts_ref.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/extracts_ref.rb b/lib/extracts_ref.rb
index 34511423d4a..d130a9d6f82 100644
--- a/lib/extracts_ref.rb
+++ b/lib/extracts_ref.rb
@@ -62,8 +62,7 @@ module ExtractsRef
#
# rubocop:disable Gitlab/ModuleWithInstanceVariables
def assign_ref_vars
- @id = get_id
- @ref, @path = extract_ref(@id)
+ @id, @ref, @path = extract_ref_path
@repo = repository_container.repository
raise InvalidPathError if @ref.match?(/\s/)
@@ -76,6 +75,13 @@ module ExtractsRef
@tree ||= @repo.tree(@commit.id, @path) # rubocop:disable Gitlab/ModuleWithInstanceVariables
end
+ def extract_ref_path
+ id = get_id
+ ref, path = extract_ref(id)
+
+ [id, ref, path]
+ end
+
private
def extract_raw_ref(id)