diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-20 12:29:35 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-20 12:29:35 +0200 |
commit | c627c8fee0111f284e36b3d5ccc8dc41acf79e14 (patch) | |
tree | c4ac0467fbf4817751a0e3bd62677bfbe79a9c8d /lib/gitlab_shell.rb | |
parent | fa6173168a953aaad1d6359f60eab62d6f2f2e74 (diff) | |
download | gitlab-shell-c627c8fee0111f284e36b3d5ccc8dc41acf79e14.tar.gz |
Fix relative path detection for ssh://host:port/repo.git
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib/gitlab_shell.rb')
-rw-r--r-- | lib/gitlab_shell.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb index 65f7786..252102f 100644 --- a/lib/gitlab_shell.rb +++ b/lib/gitlab_shell.rb @@ -88,7 +88,9 @@ class GitlabShell end def escape_path(path) - if File.absolute_path(path, repos_path) == File.join(repos_path, path) + full_repo_path = File.join(repos_path, path) + + if File.absolute_path(full_repo_path) == full_repo_path path else raise "Wrong repository path" |