mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
fix potential bugs, detected by findbugs and pmd
This commit is contained in:
@@ -36,7 +36,6 @@ package sonia.scm.repository;
|
|||||||
//~--- non-JDK imports --------------------------------------------------------
|
//~--- non-JDK imports --------------------------------------------------------
|
||||||
|
|
||||||
import org.eclipse.jgit.diff.DiffFormatter;
|
import org.eclipse.jgit.diff.DiffFormatter;
|
||||||
import org.eclipse.jgit.lib.Constants;
|
|
||||||
import org.eclipse.jgit.lib.ObjectId;
|
import org.eclipse.jgit.lib.ObjectId;
|
||||||
import org.eclipse.jgit.lib.Ref;
|
import org.eclipse.jgit.lib.Ref;
|
||||||
import org.eclipse.jgit.lib.RepositoryCache;
|
import org.eclipse.jgit.lib.RepositoryCache;
|
||||||
|
|||||||
@@ -275,11 +275,15 @@ public class GitReceiveHook implements PreReceiveHook, PostReceiveHook
|
|||||||
scriptName = FILE_HOOK_PRE_RECEIVE;
|
scriptName = FILE_HOOK_PRE_RECEIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
File hookScript = getHookScript(directory, scriptName);
|
if (scriptName != null)
|
||||||
|
|
||||||
if (hookScript != null)
|
|
||||||
{
|
{
|
||||||
executeFileHook(rpack, rc, hookScript, oldId, newId, rc.getRefName());
|
File hookScript = getHookScript(directory, scriptName);
|
||||||
|
|
||||||
|
if (hookScript != null)
|
||||||
|
{
|
||||||
|
executeFileHook(rpack, rc, hookScript, oldId, newId,
|
||||||
|
rc.getRefName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fireHookEvent(rpack, rc, directory, oldId, newId, type);
|
fireHookEvent(rpack, rc, directory, oldId, newId, type);
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ import sonia.scm.util.Util;
|
|||||||
//~--- JDK imports ------------------------------------------------------------
|
//~--- JDK imports ------------------------------------------------------------
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|||||||
@@ -62,9 +62,10 @@ public class ScmLogFilePropertyDefiner extends PropertyDefinerBase
|
|||||||
File logDirectory = new File(SCMContext.getContext().getBaseDirectory(),
|
File logDirectory = new File(SCMContext.getContext().getBaseDirectory(),
|
||||||
LOG_DIRECTORY);
|
LOG_DIRECTORY);
|
||||||
|
|
||||||
if (!logDirectory.exists())
|
if (!logDirectory.exists() &&!logDirectory.mkdirs())
|
||||||
{
|
{
|
||||||
logDirectory.mkdirs();
|
throw new ConfigurationException(
|
||||||
|
"could not create log directory ".concat(logDirectory.getPath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logDirectoryPath = logDirectory.getAbsolutePath();
|
this.logDirectoryPath = logDirectory.getAbsolutePath();
|
||||||
|
|||||||
Reference in New Issue
Block a user