| Summary: | JGit pgm should extract usage of System.exit() into a Main class wrapper to enable embedding | ||
|---|---|---|---|
| Product: | [Technology] JGit | Reporter: | Lincoln Baxter, III <lincolnbaxter> |
| Component: | JGit | Assignee: | Project Inbox <jgit.core-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | caniszczyk, sop |
| Version: | 0.12 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
We'd love contributions! http://wiki.eclipse.org/EGit/Contributor_Guide Use the api package, not the pgm package. The api package offers about the same usage, but is designed to be run from your own application code. |
Build Identifier: It is currently impossible to use JGit PGM in embedded java applications because of the use of System.exit() in pgm class files. For example:... protected void parseArguments(final String[] args) { final CmdLineParser clp = new CmdLineParser(this); try { clp.parseArgument(args); } catch (CmdLineException err) { if (!help) { System.err.println(MessageFormat.format(CLIText.get().fatalError, err.getMessage())); System.exit(1); } } ... } Reproducible: Always Steps to Reproduce: 1. Run Main.main(args...) with a bad git command 2. JVM exits, which is unrecoverable