summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-05-02 09:58:06 -0400
committerJames Moger <james.moger@gitblit.com>2013-05-02 09:58:06 -0400
commit4b4e708d32f56cd8c7d22c951042ba557b6903df (patch)
tree102a32a9dfeb33a9538050b3b182c5ae60098932
parent9a6a428bad30be341e4df2c6b0f77d9b9e9881ca (diff)
downloadgitblit-4b4e708d32f56cd8c7d22c951042ba557b6903df.tar.gz
gitblit-4b4e708d32f56cd8c7d22c951042ba557b6903df.zip
Do not include push-restricted, empty repositories for users without push access
-rw-r--r--src/main/java/com/gitblit/GitBlit.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/GitBlit.java b/src/main/java/com/gitblit/GitBlit.java
index 4fa6f4f0..377a7b3d 100644
--- a/src/main/java/com/gitblit/GitBlit.java
+++ b/src/main/java/com/gitblit/GitBlit.java
@@ -1294,7 +1294,15 @@ public class GitBlit implements ServletContextListener {
for (String repo : list) {
RepositoryModel model = getRepositoryModel(user, repo);
if (model != null) {
- repositories.add(model);
+ if (!model.hasCommits) {
+ // only add empty repositories that user can push to
+ if (UserModel.ANONYMOUS.canPush(model)
+ || user != null && user.canPush(model)) {
+ repositories.add(model);
+ }
+ } else {
+ repositories.add(model);
+ }
}
}
if (getBoolean(Keys.web.showRepositorySizes, true)) {