Search in sources :

Example 1 with GitCommandLine

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

the class RemoteCommandImpl method call.

@Override
public void call() throws VcsException {
    if (myCommand == null) {
        throw new IllegalStateException("Please specify command");
    }
    final GitCommandLine cmd = getCmd();
    cmd.addParameters("remote", myCommand, myName);
    runCmd(cmd.stdErrLogLevel("debug"));
}
Also used : GitCommandLine(jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine)

Example 2 with GitCommandLine

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

the class TagCommandImpl method call.

@Override
public void call() throws VcsException {
    GitCommandLine cmd = getCmd().stdErrExpected(false);
    cmd.addParameter("tag");
    if (myDelete) {
        cmd.addParameter("-d");
    }
    if (myAnnotate) {
        cmd.addParameters("-a", "-m", myMessage);
        if (StringUtil.isNotEmpty(myTaggerName)) {
            cmd.addEnvParam("GIT_COMMITTER_NAME", myTaggerName);
            cmd.addEnvParam("GIT_COMMITTER_EMAIL", myTaggerEmail);
        }
    }
    if (myForce) {
        cmd.addParameter("-f");
    }
    if (myName != null) {
        cmd.addParameter(myName);
    }
    if (myCommit != null) {
        cmd.addParameter(myCommit);
    }
    CommandUtil.runCommand(cmd.stdErrExpected(false), 60);
}
Also used : GitCommandLine(jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine)

Example 3 with GitCommandLine

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

the class AgentGitFacadeImpl method listBranches.

@NotNull
public Branches listBranches(boolean all) throws VcsException {
    GitCommandLine cmd = createCommandLine();
    cmd.addParameter("branch");
    if (all)
        cmd.addParameter("-a");
    return parseBranches(CommandUtil.runCommand(cmd.stdErrExpected(false)).getStdout());
}
Also used : GitCommandLine(jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine) NotNull(org.jetbrains.annotations.NotNull)

Example 4 with GitCommandLine

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

the class CheckoutCommandImpl method call.

public void call() throws VcsException {
    GitCommandLine cmd = getCmd();
    cmd.addParameters("checkout", "-q");
    if (myForce)
        cmd.addParameter("-f");
    cmd.addParameter(myBranch);
    runCmd(cmd);
}
Also used : GitCommandLine(jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine)

Example 5 with GitCommandLine

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

the class DeleteTagCommandImpl method call.

public void call() throws VcsException {
    GitCommandLine cmd = getCmd();
    cmd.addParameter("tag");
    cmd.addParameter("-d");
    cmd.addParameter(myName);
    CommandUtil.runCommand(cmd);
}
Also used : GitCommandLine(jetbrains.buildServer.buildTriggers.vcs.git.command.GitCommandLine)

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