use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitExec in project teamcity-git by JetBrains.
the class GitRepoOperationsImpl method detectGitInternal.
@NotNull
private GitExec detectGitInternal() throws VcsException {
final String gitPath = myConfig.getPathToGit();
if (StringUtil.isEmpty(gitPath)) {
throw new VcsException("No path to git provided: please specify path to git executable using \"teamcity.server.git.executable.path\" server startup property");
}
GitVersion gitVersion;
try {
gitVersion = IOGuard.allowCommandLine(() -> new GitFacadeImpl(new File("."), new StubContext(gitPath)).version().call());
} catch (VcsException e) {
throw new VcsException("Unable to run git at path \"" + gitPath + "\": please specify correct path to git executable using \"teamcity.server.git.executable.path\" server startup property, error: " + e.getMessage(), e);
}
if (gitVersion.isSupported()) {
return new GitExec(gitPath, gitVersion, null);
}
throw new VcsException("TeamCity supports git version " + GitVersion.DEPRECATED + " or higher, detected git (path \"" + gitPath + "\") has version " + gitVersion + ".\n" + "Please install the latest git version");
}
Aggregations