use of jetbrains.buildServer.buildTriggers.vcs.git.command.impl.ProcessTimeoutCallback in project teamcity-git by JetBrains.
the class AgentGitFacadeImpl method resolvePath.
@NotNull
public String resolvePath(@NotNull File f) throws VcsException {
try {
final GitExec gitExec = getCtx().getGitExec();
if (gitExec.isCygwin()) {
String cygwinBin = gitExec.getCygwinBinPath();
GeneralCommandLine cmd = new GeneralCommandLine();
cmd.setWorkDirectory(cygwinBin);
cmd.setExePath(new File(cygwinBin, "cygpath.exe").getCanonicalPath());
cmd.addParameter(f.getCanonicalPath());
ExecResult res = SimpleCommandLineProcessRunner.runCommandSecure(cmd, cmd.getCommandLineString(), null, new ProcessTimeoutCallback(30));
Throwable error = res.getException();
if (error != null)
throw error;
return res.getStdout().trim();
} else {
return f.getCanonicalPath();
}
} catch (Throwable e) {
throw new VcsException("Error while resolving path " + f.getAbsolutePath() + ": " + e.getMessage(), e);
}
}
Aggregations