mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-12-22 08:19:47 +01:00
indent and logging
This commit is contained in:
@@ -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
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user