aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rhodecode/model/repo.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/rhodecode/model/repo.py b/rhodecode/model/repo.py
index f7b7b976..e03bb6b6 100644
--- a/rhodecode/model/repo.py
+++ b/rhodecode/model/repo.py
@@ -332,6 +332,12 @@ class RepoModel(BaseModel):
SystemCommand.change_ownership(cur_repo.repo_name,
new_system_name)
+ repo_path = os.path.join(self.repos_path, cur_repo.repo_name)
+ if not cur_repo.private:
+ os.chmod(repo_path, 02775)
+ else:
+ os.chmod(repo_path, 02770)
+
if org_repo_name != new_name:
# rename repository
self.__rename_repo(old=org_repo_name, new=new_name)
@@ -715,7 +721,10 @@ class RepoModel(BaseModel):
# Old value here was 0775. We need directory to be sgid, in order to
# correctly work with git-shell. Value is calculated with values from
# the python stat library.
- os.chmod(repo_path, 02775)
+ if not repo.private:
+ os.chmod(repo_path, 02775)
+ else:
+ os.chmod(repo_path, 02770)
SystemCommand.change_ownership("%s%s%s" % (new_parent_path,
self.URL_SEPARATOR,
repo_name),