Search in sources :

Example 31 with GitCommandLine

use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine in project teamcity-git by JetBrains.

the class CreateBranchCommandImpl method call.

public void call() throws VcsException {
    GitCommandLine cmd = getCmd();
    cmd.addParameter("branch");
    cmd.addParameter("--create-reflog");
    if (myTrack) {
        cmd.addParameter("--track");
    } else {
        cmd.addParameter("--no-track");
    }
    cmd.addParameter(myName);
    if (myStartPoint != null) {
        cmd.addParameter(myStartPoint);
    }
    CommandUtil.runCommand(cmd.stdErrExpected(false));
}
Also used : GitCommandLine(jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine)

Example 32 with GitCommandLine

use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine in project teamcity-git by JetBrains.

the class PushCommandImpl method call.

@Override
public void call() throws VcsException {
    final GitCommandLine cmd = getCmd();
    cmd.addParameter("push");
    if (Loggers.VCS.isDebugEnabled()) {
        cmd.addParameter("-v");
    }
    cmd.addParameter(getRemote());
    myRefSpecs.forEach(refSpec -> cmd.addParameter(refSpec));
    runCmd(cmd.stdErrLogLevel("debug"));
}
Also used : GitCommandLine(jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine)

Example 33 with GitCommandLine

use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine in project teamcity-git by JetBrains.

the class UpdateRefCommandImpl method call.

public void call() throws VcsException {
    GitCommandLine cmd = getCmd();
    cmd.addParameter("update-ref");
    if (myDelete)
        cmd.addParameter("-d");
    cmd.addParameter(myRef);
    if (myRevision != null)
        cmd.addParameter(myRevision);
    if (myOldValue != null)
        cmd.addParameter(myOldValue);
    CommandUtil.runCommand(cmd.stdErrExpected(false));
}
Also used : GitCommandLine(jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine)

Example 34 with GitCommandLine

use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine in project teamcity-git by JetBrains.

the class VersionCommandImpl method call.

@NotNull
public GitVersion call() throws VcsException {
    GitCommandLine cmd = getCmd().repeatOnEmptyOutput(true).stdErrExpected(false);
    cmd.addParameter("version");
    return GitVersion.parse(CommandUtil.runCommand(cmd, 60).getStdout());
}
Also used : GitCommandLine(jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine) NotNull(org.jetbrains.annotations.NotNull)

Example 35 with GitCommandLine

use of jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine in project teamcity-git by JetBrains.

the class LsRemoteCommandImpl method call.

@NotNull
public List<Ref> call() throws VcsException {
    GitCommandLine cmd = getCmd();
    cmd.addParameter("ls-remote");
    cmd.addParameter("origin");
    return parse(runCmd(cmd.stdErrLogLevel("debug")).getStdout());
}
Also used : GitCommandLine(jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

GitCommandLine (jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine)36 NotNull (org.jetbrains.annotations.NotNull)6 GitVersion (jetbrains.buildServer.buildTriggers.vcs.git.GitVersion)5 ExecResult (jetbrains.buildServer.ExecResult)4 File (java.io.File)3 VcsException (jetbrains.buildServer.vcs.VcsException)3 AgentGitCommandLine (jetbrains.buildServer.buildTriggers.vcs.git.agent.AgentGitCommandLine)2 AgentGitFacadeImpl (jetbrains.buildServer.buildTriggers.vcs.git.agent.AgentGitFacadeImpl)2 FetchCommandImpl (jetbrains.buildServer.buildTriggers.vcs.git.command.impl.FetchCommandImpl)2 StubContext (jetbrains.buildServer.buildTriggers.vcs.git.command.impl.StubContext)2 SkipException (org.testng.SkipException)2 Test (org.testng.annotations.Test)2 ShowRefResult (jetbrains.buildServer.buildTriggers.vcs.git.agent.command.ShowRefResult)1 Nullable (org.jetbrains.annotations.Nullable)1