]> source.dussan.org Git - gitblit.git/commitdiff
Do not log empty messages in the receive pack
authorJames Moger <james.moger@gitblit.com>
Fri, 28 Feb 2014 18:58:05 +0000 (13:58 -0500)
committerJames Moger <james.moger@gitblit.com>
Fri, 28 Feb 2014 18:58:05 +0000 (13:58 -0500)
src/main/java/com/gitblit/git/GitblitReceivePack.java

index 1678a702138fdaf99ec9556544798749fee670dd..35f0d866b40592569b7d743daa3d8c22e88de39c 100644 (file)
@@ -416,7 +416,9 @@ public class GitblitReceivePack extends ReceivePack implements PreReceiveHook, P
                        text = MessageFormat.format(msg, objects);\r
                        super.sendMessage(prefix + text);\r
                }\r
-               LOGGER.info(text + " (" + user.username + ")");\r
+               if (!StringUtils.isEmpty(msg)) {\r
+                       LOGGER.info(text + " (" + user.username + ")");\r
+               }\r
        }\r
 \r
        protected void sendError(String msg, Object... objects) {\r
@@ -428,7 +430,9 @@ public class GitblitReceivePack extends ReceivePack implements PreReceiveHook, P
                        text = MessageFormat.format(msg, objects);\r
                        super.sendError(text);\r
                }\r
-               LOGGER.error(text + " (" + user.username + ")");\r
+               if (!StringUtils.isEmpty(msg)) {\r
+                       LOGGER.error(text + " (" + user.username + ")");\r
+               }\r
        }\r
 \r
        /**\r