summaryrefslogtreecommitdiff
path: root/lib/gitlab/git/path_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/git/path_helper.rb')
-rw-r--r--lib/gitlab/git/path_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/git/path_helper.rb b/lib/gitlab/git/path_helper.rb
index 155cf52f050..57b82a37d6c 100644
--- a/lib/gitlab/git/path_helper.rb
+++ b/lib/gitlab/git/path_helper.rb
@@ -6,7 +6,7 @@ module Gitlab
class << self
def normalize_path(filename)
# Strip all leading slashes so that //foo -> foo
- filename[%r{^/*}] = ''
+ filename = filename.sub(%r{\A/*}, '')
# Expand relative paths (e.g. foo/../bar)
filename = Pathname.new(filename)