use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine in project teamcity-git by JetBrains.
the class SubmoduleInitCommandImpl method call.
public void call() throws VcsException {
GitCommandLine cmd = getCmd();
cmd.addParameter("submodule");
cmd.addParameter("init");
CommandUtil.runCommand(cmd);
}
use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine in project teamcity-git by JetBrains.
the class GetConfigCommandImpl method callWithLevel.
private String callWithLevel(boolean abnormalExitExpected) throws VcsException {
GitCommandLine cmd = getCmd();
cmd.addParameters("config", myName);
return CommandUtil.runCommand(cmd.abnormalExitExpected(abnormalExitExpected).stdErrExpected(false)).getStdout().trim();
}
use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine in project teamcity-git by JetBrains.
the class LsTreeCommandImpl method call.
@Override
public LsTreeResult call() throws VcsException {
GitCommandLine cmd = getCmd();
cmd.addParameter("ls-tree");
if (revision != null)
cmd.addParameter(revision);
if (path != null)
cmd.addParameter(path);
ExecResult r = CommandUtil.runCommand(cmd);
String stdout = r.getStdout().trim();
return StringUtil.isEmpty(stdout) ? null : parseLsTreeOutput(stdout);
}
use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine in project teamcity-git by JetBrains.
the class SetConfigCommandImpl method call.
public void call() throws VcsException {
GitCommandLine cmd = getCmd();
if (myUnSet) {
cmd.addParameters("config", "--unset", myPropertyName);
} else {
cmd.addParameters("config", myPropertyName, myValue);
}
CommandUtil.runCommand(cmd.stdErrExpected(false));
}
use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine in project teamcity-git by JetBrains.
the class ShowRefCommandImpl method call.
@NotNull
public ShowRefResult call() {
GitCommandLine cmd = getCmd();
cmd.addParameter("show-ref");
if (myPattern != null)
cmd.addParameters(myPattern);
if (myShowTags)
cmd.addParameter("--tags");
try {
ExecResult result = CommandUtil.runCommand(cmd);
return new ShowRefResult(parseValidRefs(result.getStdout()), parseInvalidRefs(result.getStderr()), result.getExitCode());
} catch (VcsException e) {
getCmd().getContext().getLogger().warning("show-ref command failed, empty result will be returned: " + e.getMessage());
return new ShowRefResult();
}
}
Aggregations