summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-07-31 20:12:49 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-07-31 20:12:49 +0300
commit2a6fc1c5debc81ac883bad4e7f9748be88a9b9ff (patch)
tree2d66cf438b29b4457830c3aecce34cb49b5b6220
parent49b119fa31d530cf2411b2c84e54b8f455e23315 (diff)
downloadgitlab-ce-2a6fc1c5debc81ac883bad4e7f9748be88a9b9ff.tar.gz
Repository#path_to_repo should always return absolute path
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--app/models/repository.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index d9b0d1fbe22..e970c449a73 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -10,8 +10,11 @@ class Repository
nil
end
+ # Return absolute path to repository
def path_to_repo
- @path_to_repo ||= File.join(Gitlab.config.gitlab_shell.repos_path, path_with_namespace + ".git")
+ @path_to_repo ||= File.expand_path(
+ File.join(Gitlab.config.gitlab_shell.repos_path, path_with_namespace + ".git")
+ )
end
def exists?