/** * Runs the hook, without performing any validity checks. * * @throws org.eclipse.jgit.api.errors.AbortedByHookException * If the underlying hook script exited with non-zero. */ protected void doRun() throws AbortedByHookException { final ByteArrayOutputStream errorByteArray = new ByteArrayOutputStream(); PrintStream hookErrRedirect = null; try { hookErrRedirect = new PrintStream(errorByteArray, false, UTF_8.name()); } catch (UnsupportedEncodingException e) { // UTF-8 is guaranteed to be available } ProcessResult result = FS.DETECTED.runHookIfPresent(getRepository(), getHookName(), getParameters(), getOutputStream(), hookErrRedirect, getStdinArgs()); if (result.isExecutedWithError()) { throw new AbortedByHookException( new String(errorByteArray.toByteArray(), UTF_8), getHookName(), result.getExitCode()); } }
/** * Runs the hook, without performing any validity checks. * * @throws org.eclipse.jgit.api.errors.AbortedByHookException * If the underlying hook script exited with non-zero. */ protected void doRun() throws AbortedByHookException { final ByteArrayOutputStream errorByteArray = new ByteArrayOutputStream(); PrintStream hookErrRedirect = null; try { hookErrRedirect = new PrintStream(errorByteArray, false, UTF_8.name()); } catch (UnsupportedEncodingException e) { // UTF-8 is guaranteed to be available } ProcessResult result = FS.DETECTED.runHookIfPresent(getRepository(), getHookName(), getParameters(), getOutputStream(), hookErrRedirect, getStdinArgs()); if (result.isExecutedWithError()) { throw new AbortedByHookException( new String(errorByteArray.toByteArray(), UTF_8), getHookName(), result.getExitCode()); } }
/** * Runs the hook, without performing any validity checks. * * @throws AbortedByHookException * If the underlying hook script exited with non-zero. */ protected void doRun() throws AbortedByHookException { final ByteArrayOutputStream errorByteArray = new ByteArrayOutputStream(); final PrintStream hookErrRedirect = new PrintStream(errorByteArray); ProcessResult result = FS.DETECTED.runHookIfPresent(getRepository(), getHookName(), getParameters(), getOutputStream(), hookErrRedirect, getStdinArgs()); if (result.isExecutedWithError()) { throw new AbortedByHookException(errorByteArray.toString(), getHookName(), result.getExitCode()); } }