summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/git/GitblitReceivePack.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/gitblit/git/GitblitReceivePack.java')
-rw-r--r--src/main/java/com/gitblit/git/GitblitReceivePack.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/git/GitblitReceivePack.java b/src/main/java/com/gitblit/git/GitblitReceivePack.java
index e6ff5721..ba200b25 100644
--- a/src/main/java/com/gitblit/git/GitblitReceivePack.java
+++ b/src/main/java/com/gitblit/git/GitblitReceivePack.java
@@ -120,6 +120,14 @@ public class GitblitReceivePack extends ReceivePack implements PreReceiveHook, P
@Override
public void onPreReceive(ReceivePack rp, Collection<ReceiveCommand> commands) {
+ if (repository.isMirror) {
+ // repository is a mirror
+ for (ReceiveCommand cmd : commands) {
+ sendRejection(cmd, "Gitblit does not allow pushes to \"{0}\" because it is a mirror!", repository.name);
+ }
+ return;
+ }
+
if (repository.isFrozen) {
// repository is frozen/readonly
for (ReceiveCommand cmd : commands) {