use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine in project teamcity-git by JetBrains.
the class SetUpstreamCommandImpl method call.
public void call() throws VcsException {
GitCommandLine cmd = getCmd();
GitVersion version = cmd.getGitVersion();
if (version.isLessThan(new GitVersion(1, 7, 0))) {
// ability to set upstream was added in 1.7.0
return;
} else if (version.isLessThan(new GitVersion(1, 8, 0))) {
cmd.addParameters("branch", "--set-upstream", myLocalBranch, myUpstreamBranch);
} else {
cmd.addParameters("branch", "--set-upstream-to=" + myUpstreamBranch);
}
CommandUtil.runCommand(cmd.stdErrExpected(false));
}
use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine in project teamcity-git by JetBrains.
the class DiffCommandImpl method call.
@NotNull
@Override
public List<String> call() throws VcsException {
GitCommandLine cmd = getCmd();
cmd.addParameter("diff");
if (myFormat != null) {
cmd.addParameter(myFormat);
}
if (myCommit1 != null) {
cmd.addParameter(myCommit1);
}
if (myCommit2 != null) {
cmd.addParameter(myCommit2);
}
ExecResult r = CommandUtil.runCommand(cmd);
String stdout = r.getStdout().trim();
return StringUtil.isEmpty(stdout) ? Collections.<String>emptyList() : Arrays.asList(StringUtil.splitByLines(stdout));
}
use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine in project teamcity-git by JetBrains.
the class ListConfigCommandImpl method call.
@NotNull
@Override
public String call() throws VcsException {
GitCommandLine cmd = getCmd();
cmd.addParameters("config", "--list");
if (!cmd.getGitVersion().isLessThan(new GitVersion(2, 8, 0))) {
cmd.addParameter("--show-origin");
}
return CommandUtil.runCommand(cmd).getStdout().trim();
}
use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine in project teamcity-git by JetBrains.
the class PackRefsImpl method call.
public void call() throws VcsException {
GitCommandLine cmd = getCmd();
cmd.addParameters("pack-refs", "--all");
CommandUtil.runCommand(cmd);
}
use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine in project teamcity-git by JetBrains.
the class ResetCommandImpl method call.
public void call() throws VcsException {
GitCommandLine cmd = getCmd();
cmd.addParameters("reset");
if (myHard)
cmd.addParameter("--hard");
cmd.addParameter(myRevision);
runCmd(cmd);
}
Aggregations