Example usage for org.eclipse.jgit.transport PushConnection getRefs

List of usage examples for org.eclipse.jgit.transport PushConnection getRefs

Introduction

In this page you can find the example usage for org.eclipse.jgit.transport PushConnection getRefs.

Prototype

Collection<Ref> getRefs();

Source Link

Document

Get the complete list of refs advertised as available for fetching or pushing.

Usage

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();
        }
    }
}