InputStream in = (stdinArgs == null) ? null : new ByteArrayInputStream( stdinArgs.getBytes(UTF_8)); return runProcess(processBuilder, outRedirect, errRedirect, in);
/** * Execute a command defined by a {@link java.lang.ProcessBuilder}. * * @param pb * The command to be executed * @param in * The standard input stream passed to the process * @return The result of the executed command * @throws java.lang.InterruptedException * @throws java.io.IOException * @since 4.2 */ public ExecutionResult execute(ProcessBuilder pb, InputStream in) throws IOException, InterruptedException { try (TemporaryBuffer stdout = new TemporaryBuffer.LocalFile(null); TemporaryBuffer stderr = new TemporaryBuffer.Heap(1024, 1024 * 1024)) { int rc = runProcess(pb, stdout, stderr, in); return new ExecutionResult(stdout, stderr, rc); } }
return new ProcessResult(runProcess(hookProcess, outRedirect, errRedirect, stdinArgs), Status.OK); } catch (IOException e) {
InputStream in = (stdinArgs == null) ? null : new ByteArrayInputStream( stdinArgs.getBytes(UTF_8)); return runProcess(processBuilder, outRedirect, errRedirect, in);
InputStream in = (stdinArgs == null) ? null : new ByteArrayInputStream( stdinArgs.getBytes(Constants.CHARACTER_ENCODING)); return runProcess(processBuilder, outRedirect, errRedirect, in);
/** * Execute a command defined by a {@link java.lang.ProcessBuilder}. * * @param pb * The command to be executed * @param in * The standard input stream passed to the process * @return The result of the executed command * @throws java.lang.InterruptedException * @throws java.io.IOException * @since 4.2 */ public ExecutionResult execute(ProcessBuilder pb, InputStream in) throws IOException, InterruptedException { try (TemporaryBuffer stdout = new TemporaryBuffer.LocalFile(null); TemporaryBuffer stderr = new TemporaryBuffer.Heap(1024, 1024 * 1024)) { int rc = runProcess(pb, stdout, stderr, in); return new ExecutionResult(stdout, stderr, rc); } }
return new ProcessResult(runProcess(hookProcess, outRedirect, errRedirect, stdinArgs), Status.OK); } catch (IOException e) {
/** * Execute a command defined by a {@link ProcessBuilder}. * * @param pb * The command to be executed * @param in * The standard input stream passed to the process * @return The result of the executed command * @throws InterruptedException * @throws IOException * @since 4.2 */ public ExecutionResult execute(ProcessBuilder pb, InputStream in) throws IOException, InterruptedException { TemporaryBuffer stdout = new TemporaryBuffer.LocalFile(null); TemporaryBuffer stderr = new TemporaryBuffer.Heap(1024, 1024 * 1024); try { int rc = runProcess(pb, stdout, stderr, in); return new ExecutionResult(stdout, stderr, rc); } finally { stdout.close(); stderr.close(); } }
hookProcess.directory(runDirectory); try { return new ProcessResult(runProcess(hookProcess, outRedirect, errRedirect, stdinArgs), Status.OK); } catch (IOException e) {
/** {@inheritDoc} */ @Override public Void call() throws Exception { StoredConfig cfg = null; if (repository == null) { cfg = loadUserConfig(); } else { cfg = repository.getConfig(); } cfg.setBoolean(ConfigConstants.CONFIG_FILTER_SECTION, ConfigConstants.CONFIG_SECTION_LFS, ConfigConstants.CONFIG_KEY_USEJGITBUILTIN, true); cfg.setBoolean(ConfigConstants.CONFIG_FILTER_SECTION, ConfigConstants.CONFIG_SECTION_LFS, ConfigConstants.CONFIG_KEY_REQUIRED, true); cfg.save(); // try to run git lfs install, we really don't care if it is present // and/or works here (yet). ProcessBuilder builder = FS.DETECTED.runInShell("git", //$NON-NLS-1$ repository == null ? ARGS_USER : ARGS_LOCAL); if (repository != null) { builder.directory(repository.isBare() ? repository.getDirectory() : repository.getWorkTree()); } FS.DETECTED.runProcess(builder, null, null, (String) null); return null; }