indent and logging

This commit is contained in:
Sebastian Sdorra
2012-09-13 16:07:23 +02:00
parent df7bd2832c
commit 81f90209f3

View File

@@ -249,11 +249,20 @@ public class GitReceiveHook implements PreReceiveHook, PostReceiveHook
{
for (ReceiveCommand rc : receiveCommands)
{
if (((RepositoryHookType.PRE_RECEIVE == type)
&& (rc.getResult()
== ReceiveCommand.Result.NOT_ATTEMPTED)) || ((RepositoryHookType
.POST_RECEIVE == type) && (rc.getResult()
== ReceiveCommand.Result.OK)))
if (logger.isTraceEnabled())
{
//J-
logger.trace("receive command, type={}, ref={}, result={}",
new Object[] {
rc.getType(),
rc.getRefName(),
rc.getResult()
}
);
//J+
}
if (isReceiveable(rc, type))
{
ObjectId newId = rc.getNewId();
ObjectId oldId = null;
@@ -345,6 +354,25 @@ public class GitReceiveHook implements PreReceiveHook, PostReceiveHook
return id;
}
/**
* Method description
*
*
* @param rc
* @param type
*
* @return
*/
private boolean isReceiveable(ReceiveCommand rc, RepositoryHookType type)
{
//J-
return ((RepositoryHookType.PRE_RECEIVE == type) &&
(rc.getResult() == ReceiveCommand.Result.NOT_ATTEMPTED)) ||
((RepositoryHookType.POST_RECEIVE == type) &&
(rc.getResult() == ReceiveCommand.Result.OK));
//J+
}
/**
* Method description
*