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