List of usage examples for org.eclipse.jgit.transport PushConnection getRefs
Collection<Ref> getRefs();
From source file:jetbrains.buildServer.buildTriggers.vcs.git.TestConnectionCommand.java
License:Apache License
private void checkPushConnection(GitVcsRoot root, Repository r) throws NotSupportedException, VcsException, TransportException { if (!root.getRepositoryFetchURLNoFixedErrors().equals(root.getRepositoryPushURLNoFixedErrors())) { validate(root.getRepositoryPushURLNoFixedErrors()); final Transport push = myTransportFactory.createTransport(r, root.getRepositoryPushURLNoFixedErrors(), root.getAuthSettings()); PushConnection c = null; try {/*from w w w . j a va 2 s . c o m*/ c = push.openPush(); c.getRefs(); } finally { if (c != null) { c.close(); } push.close(); } } }