diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-06-29 13:58:20 -0400 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-06-29 13:58:20 -0400 |
commit | 18b4d39ac7172cb02cec63e7bf1cc21807a9b3f0 (patch) | |
tree | 810dd76a8b3bea1048e5951cefd4d1eeee5aaefd /lib/names_helper.rb | |
parent | 5a6d71d143a6ea5f9747b25304aafa902ed381d0 (diff) | |
download | gitlab-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.rb | 5 |
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) |