Search in sources :

Example 6 with NamedProcessTag

use of com.thoughtworks.go.util.NamedProcessTag in project gocd by gocd.

the class GitCommand method checkConnection.

public void checkConnection(UrlArgument repoUrl) {
    final String ref = fullUpstreamRef();
    final CommandLine commandLine = git().withArgs("ls-remote", "--").withArg(repoUrl).withArg(ref);
    final ConsoleResult result = commandLine.runOrBomb(new NamedProcessTag(repoUrl.forDisplay()));
    if (!hasExactlyOneMatchingBranch(result)) {
        throw new CommandLineException(format("The ref %s could not be found.", ref));
    }
}
Also used : NamedProcessTag(com.thoughtworks.go.util.NamedProcessTag)

Aggregations

NamedProcessTag (com.thoughtworks.go.util.NamedProcessTag)6 CommandLine.createCommandLine (com.thoughtworks.go.util.command.CommandLine.createCommandLine)3 CommandLine (com.thoughtworks.go.util.command.CommandLine)1 InMemoryStreamConsumer (com.thoughtworks.go.util.command.InMemoryStreamConsumer)1 File (java.io.File)1