Package org.eclipse.jgit.pgm
Class CLIGitCommand
java.lang.Object
org.eclipse.jgit.pgm.Main
org.eclipse.jgit.pgm.CLIGitCommand
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.eclipse.jgit.pgm.Main
Main.SubcommandLineParser
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String[]
convertToMainArgs
(String str) (package private) PrintWriter
execute
(String str, Repository db) static CLIGitCommand.Result
executeRaw
(String str, Repository db) executeUnchecked
(String str, Repository db) (package private) void
getOutput
(CLIGitCommand.Result result) (package private) void
init
(TextBuiltin cmd) static void
Executes git commands (with arguments) specified on the command line.protected Repository
openGitDir
(String aGitdir) Evaluate the--git-dir
option and open the repository.private void
(package private) static String[]
Split a command line into a string array.Methods inherited from class org.eclipse.jgit.pgm.Main
configureHttpProxy, run
-
Field Details
-
result
-
db
-
-
Constructor Details
-
CLIGitCommand
-
-
Method Details
-
main
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
- Throws:
Exception
-
executeRaw
- Throws:
Exception
-
executeUnchecked
- Throws:
Exception
-
getOutput
-
run
- Throws:
Exception
-
convertToMainArgs
- Throws:
Exception
-
createErrorWriter
PrintWriter createErrorWriter()- Overrides:
createErrorWriter
in classMain
-
init
- Overrides:
init
in classMain
- Throws:
IOException
-
openGitDir
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.
-
exit
-
split
Split a command line into a string array. A copy of Gerrit's com.google.gerrit.sshd.CommandFactoryProvider#split(String)- Parameters:
commandLine
- a command line- Returns:
- the array
-