Class CLIGitCommand

java.lang.Object
org.eclipse.jgit.pgm.Main
org.eclipse.jgit.pgm.CLIGitCommand

public class CLIGitCommand extends Main
  • Constructor Details

    • CLIGitCommand

      public CLIGitCommand(Repository db)
  • Method Details

    • main

      public static void main(String[] args) throws Exception
      Executes git commands (with arguments) specified on the command line. The git repository (same for all commands) can be specified via system property "-Dgit_work_tree=path_to_work_tree". If the property is not set, current directory is used.
      Parameters:
      args - each element in the array must be a valid git command line, e.g. "git branch -h"
      Throws:
      Exception
    • execute

      public static List<String> execute(String str, Repository db) throws Exception
      Throws:
      Exception
    • executeRaw

      public static CLIGitCommand.Result executeRaw(String str, Repository db) throws Exception
      Throws:
      Exception
    • executeUnchecked

      public static List<String> executeUnchecked(String str, Repository db) throws Exception
      Throws:
      Exception
    • openGitDir

      protected Repository openGitDir(String aGitdir) throws IOException
      Description copied from class: Main
      Evaluate the --git-dir option and open the repository.
      Overrides:
      openGitDir in class Main
      Parameters:
      aGitdir - the --git-dir option given on the command line. May be null if it was not supplied.
      Returns:
      the repository to operate on.
      Throws:
      IOException - the repository cannot be opened.