James Moger
2013-11-13 c44dd099a432094a12131cf60dfc8a19f5aa8101
src/main/java/com/gitblit/git/GitblitReceivePack.java
@@ -120,6 +120,14 @@
   @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) {
@@ -389,14 +397,22 @@
      LOGGER.error(text + " (" + user.username + ")");
   }
   protected void sendHeader(String msg, Object... objects) {
      sendMessage("--->", msg, objects);
   }
   protected void sendMessage(String msg, Object... objects) {
      sendMessage("    ", msg, objects);
   }
   protected void sendMessage(String prefix, String msg, Object... objects) {
      String text;
      if (ArrayUtils.isEmpty(objects)) {
         text = msg;
         super.sendMessage(msg);
         super.sendMessage(prefix + msg);
      } else {
         text = MessageFormat.format(msg, objects);
         super.sendMessage(text);
         super.sendMessage(prefix + text);
      }
      LOGGER.info(text + " (" + user.username + ")");
   }
@@ -421,7 +437,7 @@
    * @param commands
    * @param scripts
    */
   protected void runGroovy(Collection<ReceiveCommand> commands, Set<String> scripts) {
   private void runGroovy(Collection<ReceiveCommand> commands, Set<String> scripts) {
      if (scripts == null || scripts.size() == 0) {
         // no Groovy scripts to execute
         return;