|
|
@ -217,7 +217,7 @@ public abstract class TextBuiltin { |
|
|
|
} catch (CmdLineException err) { |
|
|
|
} catch (CmdLineException err) { |
|
|
|
if (!help) { |
|
|
|
if (!help) { |
|
|
|
this.errw.println(MessageFormat.format(CLIText.get().fatalError, err.getMessage())); |
|
|
|
this.errw.println(MessageFormat.format(CLIText.get().fatalError, err.getMessage())); |
|
|
|
throw die(true); |
|
|
|
throw die(true, err); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -324,6 +324,19 @@ public abstract class TextBuiltin { |
|
|
|
return new Die(aborted); |
|
|
|
return new Die(aborted); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @param aborted |
|
|
|
|
|
|
|
* boolean indicating that the execution has been aborted before |
|
|
|
|
|
|
|
* running |
|
|
|
|
|
|
|
* @param cause |
|
|
|
|
|
|
|
* why the command has failed. |
|
|
|
|
|
|
|
* @return a runtime exception the caller is expected to throw |
|
|
|
|
|
|
|
* @since 4.2 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
protected static Die die(boolean aborted, final Throwable cause) { |
|
|
|
|
|
|
|
return new Die(aborted, cause); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String abbreviateRef(String dst, boolean abbreviateRemote) { |
|
|
|
String abbreviateRef(String dst, boolean abbreviateRemote) { |
|
|
|
if (dst.startsWith(R_HEADS)) |
|
|
|
if (dst.startsWith(R_HEADS)) |
|
|
|
dst = dst.substring(R_HEADS.length()); |
|
|
|
dst = dst.substring(R_HEADS.length()); |
|
|
|