@ -45,7 +45,6 @@
package org.eclipse.jgit.pgm.opt ;
package org.eclipse.jgit.pgm.opt ;
import java.io.IOException ;
import java.io.IOException ;
import java.text.MessageFormat ;
import org.eclipse.jgit.errors.IncorrectObjectTypeException ;
import org.eclipse.jgit.errors.IncorrectObjectTypeException ;
import org.eclipse.jgit.errors.MissingObjectException ;
import org.eclipse.jgit.errors.MissingObjectException ;
@ -97,9 +96,8 @@ public class RevCommitHandler extends OptionHandler<RevCommit> {
if ( dot2 ! = - 1 ) {
if ( dot2 ! = - 1 ) {
if ( ! option . isMultiValued ( ) )
if ( ! option . isMultiValued ( ) )
throw new CmdLineException ( clp ,
throw new CmdLineException ( clp ,
MessageFormat . format (
CLIText . format ( CLIText . get ( ) . onlyOneMetaVarExpectedIn ) ,
CLIText . get ( ) . onlyOneMetaVarExpectedIn ,
option . metaVar ( ) , name ) ;
option . metaVar ( ) , name ) ) ;
final String left = name . substring ( 0 , dot2 ) ;
final String left = name . substring ( 0 , dot2 ) ;
final String right = name . substring ( dot2 + 2 ) ;
final String right = name . substring ( dot2 + 2 ) ;
@ -118,20 +116,25 @@ public class RevCommitHandler extends OptionHandler<RevCommit> {
try {
try {
id = clp . getRepository ( ) . resolve ( name ) ;
id = clp . getRepository ( ) . resolve ( name ) ;
} catch ( IOException e ) {
} catch ( IOException e ) {
throw new CmdLineException ( clp , e . getMessage ( ) ) ;
throw new CmdLineException ( clp , CLIText . format ( e . getMessage ( ) ) ) ;
}
}
if ( id = = null )
if ( id = = null )
throw new CmdLineException ( clp , MessageFormat . format ( CLIText . get ( ) . notACommit , name ) ) ;
throw new CmdLineException ( clp ,
CLIText . format ( CLIText . get ( ) . notACommit ) , name ) ;
final RevCommit c ;
final RevCommit c ;
try {
try {
c = clp . getRevWalk ( ) . parseCommit ( id ) ;
c = clp . getRevWalk ( ) . parseCommit ( id ) ;
} catch ( MissingObjectException e ) {
} catch ( MissingObjectException e ) {
throw new CmdLineException ( clp , MessageFormat . format ( CLIText . get ( ) . notACommit , name ) ) ;
throw new CmdLineException ( clp ,
CLIText . format ( CLIText . get ( ) . notACommit ) , name ) ;
} catch ( IncorrectObjectTypeException e ) {
} catch ( IncorrectObjectTypeException e ) {
throw new CmdLineException ( clp , MessageFormat . format ( CLIText . get ( ) . notACommit , name ) ) ;
throw new CmdLineException ( clp ,
CLIText . format ( CLIText . get ( ) . notACommit ) , name ) ;
} catch ( IOException e ) {
} catch ( IOException e ) {
throw new CmdLineException ( clp , MessageFormat . format ( CLIText . get ( ) . cannotReadBecause , name , e . getMessage ( ) ) ) ;
throw new CmdLineException ( clp ,
CLIText . format ( CLIText . get ( ) . cannotReadBecause ) , name ,
e . getMessage ( ) ) ;
}
}
if ( interesting )
if ( interesting )