e); } catch (TransportException e) { throw new org.eclipse.jgit.api.errors.TransportException( e.getMessage(), e);
return !result.isEmpty(); } catch (TransportException ex) { String message = ex.getMessage(); if (message.endsWith("not authorized") || message.endsWith("Auth fail") || message.contains("Too many authentication failures")
} catch (TransportException e2) { gitUrl = null; e2.printStackTrace(); } catch (GitAPIException e2) { gitUrl = null;
repo.close(); } catch (TransportException e) { Throwable cause1 = e.getCause(); if (cause1 != null && cause1.getCause() instanceof SSLHandshakeException) { throw new SLException(cause1.getCause(), "Failed to establish ssl connection"); // NOSONAR
public void pullRepo() { try { git.pull().setRemote(REMOTE_NAME).setRemoteBranchName(MASTER_BRANCH).setRebase(false).call(); } catch (InvalidRemoteException e) { e.printStackTrace(); } catch (TransportException e) { e.printStackTrace(); } catch (GitAPIException e) { e.printStackTrace(); } }
repo.close(); } catch (TransportException e) { Throwable cause1 = e.getCause(); if (cause1 != null && cause1.getCause() instanceof SSLHandshakeException) { throw new SLException(cause1.getCause(), "Failed to establish ssl connection"); // NOSONAR
e.getMessage(), e); } catch (TransportException e) { throw new org.eclipse.jgit.api.errors.TransportException( e.getMessage(), e); } finally { JGitText.get().invalidRemote, remote)); } catch (TransportException e) { throw new org.eclipse.jgit.api.errors.TransportException( e.getMessage(), e); } catch (NotSupportedException e) {
public void pullRepo(String uri, String branch) { try { setRemote(uri); git.pull().setRemote(REMOTE_NAME).setRemoteBranchName(branch).setRebase(false).call(); } catch (InvalidRemoteException e) { e.printStackTrace(); } catch (TransportException e) { e.printStackTrace(); } catch (GitAPIException e) { e.printStackTrace(); } }
/** * This method performs 'git push' programmically * * @throws GitWorkflowException */ public void pushChanges(GitConfiguration gitConfig, String commitMessage) throws GitWorkflowException { try (Git git = Git.open(new File(botConfig.getBotRefactoringDirectory() + gitConfig.getConfigurationId()))) { // Perform 'git add .' git.add().addFilepattern(".").call(); // Perform 'git commit -m' git.commit().setMessage(commitMessage).setCommitter(gitConfig.getBotName(), gitConfig.getBotEmail()).call(); // Push with bot credenials git.push().setCredentialsProvider(new UsernamePasswordCredentialsProvider(gitConfig.getBotToken(), "")) .call(); } catch (TransportException t) { logger.error(t.getMessage(), t); throw new GitWorkflowException("Wrong bot token!"); } catch (Exception e) { logger.error(e.getMessage(), e); throw new GitWorkflowException("Could not successfully perform 'git push'!"); } }
JGitText.get().invalidRemote, remote), e); } catch (TransportException e) { throw new org.eclipse.jgit.api.errors.TransportException( e.getMessage(), e); } catch (URISyntaxException e) {
public void initRepo() { if (exists()) { return; } try { Git.init().setDirectory(getRootDir()).setBare(false).call(); } catch (InvalidRemoteException e) { e.printStackTrace(); } catch (TransportException e) { e.printStackTrace(); } catch (GitAPIException e) { e.printStackTrace(); } }
return; } catch (TransportException te) { responder.invalidRequest("Unable to connect to git repo due to: " + te.getMessage()); return; } finally {
e); } catch (TransportException e) { throw new org.eclipse.jgit.api.errors.TransportException( e.getMessage(), e);
public void pushRepo(String uri, GitUser user) { try { setRemote(uri); git.push().setRemote(REMOTE_NAME).setCredentialsProvider(new UsernamePasswordCredentialsProvider(user.getUsername(), user.getPassword())).call(); } catch (InvalidRemoteException e) { e.printStackTrace(); } catch (TransportException e) { e.printStackTrace(); } catch (GitAPIException e) { e.printStackTrace(); } }
e); } catch (TransportException e) { throw new org.eclipse.jgit.api.errors.TransportException( e.getMessage(), e);
e.printStackTrace(); } catch (TransportException e) { e.printStackTrace(); } catch (GitAPIException e) { e.printStackTrace();
e.getMessage(), e); } catch (TransportException e) { throw new org.eclipse.jgit.api.errors.TransportException( e.getMessage(), e); } finally { JGitText.get().invalidRemote, remote)); } catch (TransportException e) { throw new org.eclipse.jgit.api.errors.TransportException( e.getMessage(), e); } catch (NotSupportedException e) {
public void addAndCommit(String message, GitUser user) { try { git.add().addFilepattern(".").call(); git.commit().setMessage(message).setAuthor(user.getName(), user.getEmail()).setCommitter(user.getName(), user.getEmail()).setAll(true).call(); } catch (InvalidRemoteException e) { e.printStackTrace(); } catch (TransportException e) { e.printStackTrace(); } catch (GitAPIException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } }
e.getMessage(), e); } catch (TransportException e) { throw new org.eclipse.jgit.api.errors.TransportException( e.getMessage(), e); } finally { JGitText.get().invalidRemote, remote)); } catch (TransportException e) { throw new org.eclipse.jgit.api.errors.TransportException( e.getMessage(), e); } catch (NotSupportedException e) {
public static void cloneRepo(String uri, File cloneTo, String branch) { Git result = null; try { result = Git.cloneRepository().setURI(uri).setDirectory(cloneTo) .setBranch(branch).setBare(false).setRemote(REMOTE_NAME) .setNoCheckout(false).setCloneAllBranches(false).setCloneSubmodules(false).call(); } catch (InvalidRemoteException e) { e.printStackTrace(); } catch (TransportException e) { e.printStackTrace(); } catch (GitAPIException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } finally { if (result != null) { result.close(); } } }