mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 00:45:44 +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 --------------------------------------------------------
|
||||
|
||||
import org.eclipse.jgit.diff.DiffFormatter;
|
||||
import org.eclipse.jgit.lib.Constants;
|
||||
import org.eclipse.jgit.lib.ObjectId;
|
||||
import org.eclipse.jgit.lib.Ref;
|
||||
import org.eclipse.jgit.lib.RepositoryCache;
|
||||
|
||||
@@ -275,11 +275,15 @@ public class GitReceiveHook implements PreReceiveHook, PostReceiveHook
|
||||
scriptName = FILE_HOOK_PRE_RECEIVE;
|
||||
}
|
||||
|
||||
if (scriptName != null)
|
||||
{
|
||||
File hookScript = getHookScript(directory, scriptName);
|
||||
|
||||
if (hookScript != null)
|
||||
{
|
||||
executeFileHook(rpack, rc, hookScript, oldId, newId, rc.getRefName());
|
||||
executeFileHook(rpack, rc, hookScript, oldId, newId,
|
||||
rc.getRefName());
|
||||
}
|
||||
}
|
||||
|
||||
fireHookEvent(rpack, rc, directory, oldId, newId, type);
|
||||
|
||||
@@ -49,7 +49,6 @@ import sonia.scm.util.Util;
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -62,9 +62,10 @@ public class ScmLogFilePropertyDefiner extends PropertyDefinerBase
|
||||
File logDirectory = new File(SCMContext.getContext().getBaseDirectory(),
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user