Class GitCommandLineUtils

java.lang.Object
org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils

public final class GitCommandLineUtils extends Object
Command line construction utility.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • VARIABLE_GIT_SSH_COMMAND

      public static final String VARIABLE_GIT_SSH_COMMAND
      See Also:
  • Constructor Details

    • GitCommandLineUtils

      private GitCommandLineUtils()
  • Method Details

    • addTarget

      public static void addTarget(org.codehaus.plexus.util.cli.Commandline commandLine, List<File> files)
    • getBaseGitCommandLine

      public static org.codehaus.plexus.util.cli.Commandline getBaseGitCommandLine(File workingDirectory, String command)
      Use this only for commands not requiring environment variables (i.e. local commands).
    • getBaseGitCommandLine

      public static org.codehaus.plexus.util.cli.Commandline getBaseGitCommandLine(File workingDirectory, String command, GitScmProviderRepository repository, Map<String,String> environment)
      Use this for commands requiring environment variables (i.e. remote commands).
    • getAnonymousBaseGitCommandLine

      private static org.codehaus.plexus.util.cli.Commandline getAnonymousBaseGitCommandLine(File workingDirectory, String command)
      Creates a Commandline for which toString() does not display the password.
      Parameters:
      workingDirectory -
      command -
      Returns:
      CommandLine with anonymous output
    • composeCommand

      private static void composeCommand(File workingDirectory, String command, org.codehaus.plexus.util.cli.Commandline commandLine)
    • execute

      public static int execute(org.codehaus.plexus.util.cli.Commandline commandline, org.codehaus.plexus.util.cli.StreamConsumer consumer, org.codehaus.plexus.util.cli.CommandLineUtils.StringStreamConsumer stderr) throws ScmException
      Throws:
      ScmException
    • execute

      public static int execute(org.codehaus.plexus.util.cli.Commandline commandLine, org.codehaus.plexus.util.cli.CommandLineUtils.StringStreamConsumer stdout, org.codehaus.plexus.util.cli.CommandLineUtils.StringStreamConsumer stderr) throws ScmException
      Throws:
      ScmException
    • prepareEnvVariablesForRepository

      static Map<String,String> prepareEnvVariablesForRepository(GitScmProviderRepository repository, Map<String,String> environmentVariables)