Package org.eclipse.jgit.pgm
Class CLIGitCommand
- java.lang.Object
-
- org.eclipse.jgit.pgm.Main
-
- org.eclipse.jgit.pgm.CLIGitCommand
-
public class CLIGitCommand extends Main
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CLIGitCommand.Result
-
Constructor Summary
Constructors Constructor Description CLIGitCommand(Repository db)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<String>
execute(String str, Repository db)
static CLIGitCommand.Result
executeRaw(String str, Repository db)
static List<String>
executeUnchecked(String str, Repository db)
static void
main(String[] args)
Executes git commands (with arguments) specified on the command line.protected Repository
openGitDir(String aGitdir)
Evaluate the--git-dir
option and open the repository.
-
-
-
Constructor Detail
-
CLIGitCommand
public CLIGitCommand(Repository db)
-
-
Method Detail
-
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 classMain
- 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.
-
-