# SINCE 1.3.0\r
git.defaultIncrementalPushTagPrefix = r\r
\r
+# In an Unix environment where mixed access methods exist for shared repositories,\r
+# the repository should be created with 'git init --shared' to make sure that\r
+# it can be accessed e.g. via ssh (user git) and http (user www-data).\r
+# Valid values are the values available for the '--shared' option. The the manual\r
+# page for 'git init' for more information on shared repositories.\r
+#\r
+# SINCE 1.3.2\r
+git.createRepositoriesShared = false\r
+\r
# Enable JGit-based garbage collection. (!!EXPERIMENTAL!!)\r
#\r
# USE AT YOUR OWN RISK!\r
}
// create repository
logger.info("create repository " + repository.name);
- r = JGitUtils.createRepository(repositoriesFolder, repository.name);
+ String shared = getString(Keys.git.createRepositoriesShared, "FALSE");
+ r = JGitUtils.createRepository(repositoriesFolder, repository.name, shared);
} else {
// rename repository
if (!repositoryName.equalsIgnoreCase(repository.name)) {
// close the repository object
r.close();
}
-
+
+ // Adjust permissions in case we updated the config files
+ JGitUtils.adjustSharedPerm(new File(r.getDirectory().getAbsolutePath(), "config"),
+ getString(Keys.git.createRepositoriesShared, "FALSE"));
+ JGitUtils.adjustSharedPerm(new File(r.getDirectory().getAbsolutePath(), "HEAD"),
+ getString(Keys.git.createRepositoriesShared, "FALSE"));
+
// update repository cache
removeFromCachedRepositoryList(repositoryName);
// model will actually be replaced on next load because config is stale