public class CLIGitCommand extends Main
Modifier and Type | Class and Description |
---|---|
static class |
CLIGitCommand.Result |
Main.SubcommandLineParser
Modifier and Type | Field and Description |
---|---|
private Repository |
db |
private CLIGitCommand.Result |
result |
Constructor and Description |
---|
CLIGitCommand(Repository db) |
Modifier and Type | Method and Description |
---|---|
private static java.lang.String[] |
convertToMainArgs(java.lang.String str) |
(package private) java.io.PrintWriter |
createErrorWriter() |
static java.util.List<java.lang.String> |
execute(java.lang.String str,
Repository db) |
static CLIGitCommand.Result |
executeRaw(java.lang.String str,
Repository db) |
static java.util.List<java.lang.String> |
executeUnchecked(java.lang.String str,
Repository db) |
(package private) void |
exit(int status,
java.lang.Exception t) |
private static java.util.List<java.lang.String> |
getOutput(CLIGitCommand.Result result) |
(package private) void |
init(TextBuiltin cmd) |
static void |
main(java.lang.String[] args)
Executes git commands (with arguments) specified on the command line.
|
protected Repository |
openGitDir(java.lang.String aGitdir)
Evaluate the
--git-dir option and open the repository. |
private void |
run(java.lang.String commandLine) |
(package private) static java.lang.String[] |
split(java.lang.String commandLine)
Split a command line into a string array.
|
configureHttpProxy, run
private final CLIGitCommand.Result result
private final Repository db
public CLIGitCommand(Repository db)
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- each element in the array must be a valid git command line,
e.g. "git branch -h"java.lang.Exception
public static java.util.List<java.lang.String> execute(java.lang.String str, Repository db) throws java.lang.Exception
java.lang.Exception
public static CLIGitCommand.Result executeRaw(java.lang.String str, Repository db) throws java.lang.Exception
java.lang.Exception
public static java.util.List<java.lang.String> executeUnchecked(java.lang.String str, Repository db) throws java.lang.Exception
java.lang.Exception
private static java.util.List<java.lang.String> getOutput(CLIGitCommand.Result result)
private void run(java.lang.String commandLine) throws java.lang.Exception
java.lang.Exception
private static java.lang.String[] convertToMainArgs(java.lang.String str) throws java.lang.Exception
java.lang.Exception
java.io.PrintWriter createErrorWriter()
createErrorWriter
in class Main
void init(TextBuiltin cmd) throws java.io.IOException
protected Repository openGitDir(java.lang.String aGitdir) throws java.io.IOException
Main
--git-dir
option and open the repository.openGitDir
in class Main
aGitdir
- the --git-dir
option given on the command line. May be
null if it was not supplied.java.io.IOException
- the repository cannot be opened.void exit(int status, java.lang.Exception t) throws java.lang.Exception
static java.lang.String[] split(java.lang.String commandLine)
commandLine
- a command line