summaryrefslogtreecommitdiff
path: root/lib/names_helper.rb
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2016-06-29 13:58:20 -0400
committerAlejandro Rodríguez <alejorro70@gmail.com>2016-06-29 13:58:20 -0400
commit18b4d39ac7172cb02cec63e7bf1cc21807a9b3f0 (patch)
tree810dd76a8b3bea1048e5951cefd4d1eeee5aaefd /lib/names_helper.rb
parent5a6d71d143a6ea5f9747b25304aafa902ed381d0 (diff)
downloadgitlab-shell-shards.tar.gz
Refactor repository paths handling to allow multiple git mount pointsshards
Diffstat (limited to 'lib/names_helper.rb')
-rw-r--r--lib/names_helper.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/names_helper.rb b/lib/names_helper.rb
index efad56f..ec41b79 100644
--- a/lib/names_helper.rb
+++ b/lib/names_helper.rb
@@ -1,10 +1,9 @@
module NamesHelper
- def extract_repo_name(path, base)
+ def extract_repo_name(path)
repo_name = path.strip
- repo_name.gsub!(base, "")
repo_name.gsub!(/\.git$/, "")
repo_name.gsub!(/^\//, "")
- repo_name
+ repo_name.split(File::SEPARATOR).last(2).join(File::SEPARATOR)
end
def extract_ref_name(ref)