@ -1,5 +1,6 @@
/ *
/ *
* Copyright ( C ) 2010 , 2012 Chris Aniszczyk < caniszczyk @gmail.com >
* Copyright ( C ) 2010 , 2012 Chris Aniszczyk < caniszczyk @gmail.com >
* Copyright ( C ) 2013 , Obeo
* and other copyright owners as documented in the project ' s IP log .
* and other copyright owners as documented in the project ' s IP log .
*
*
* This program and the accompanying materials are made available
* This program and the accompanying materials are made available
@ -47,6 +48,7 @@ import java.text.MessageFormat;
import org.eclipse.jgit.api.CheckoutCommand ;
import org.eclipse.jgit.api.CheckoutCommand ;
import org.eclipse.jgit.api.Git ;
import org.eclipse.jgit.api.Git ;
import org.eclipse.jgit.api.errors.CheckoutConflictException ;
import org.eclipse.jgit.api.errors.RefAlreadyExistsException ;
import org.eclipse.jgit.api.errors.RefAlreadyExistsException ;
import org.eclipse.jgit.api.errors.RefNotFoundException ;
import org.eclipse.jgit.api.errors.RefNotFoundException ;
import org.eclipse.jgit.lib.Constants ;
import org.eclipse.jgit.lib.Constants ;
@ -107,6 +109,11 @@ class Checkout extends TextBuiltin {
} catch ( RefAlreadyExistsException e ) {
} catch ( RefAlreadyExistsException e ) {
throw die ( MessageFormat . format ( CLIText . get ( ) . branchAlreadyExists ,
throw die ( MessageFormat . format ( CLIText . get ( ) . branchAlreadyExists ,
name ) ) ;
name ) ) ;
} catch ( CheckoutConflictException e ) {
outw . println ( CLIText . get ( ) . checkoutConflict ) ;
for ( String path : e . getConflictingPaths ( ) )
outw . println ( MessageFormat . format (
CLIText . get ( ) . checkoutConflictPathLine , path ) ) ;
}
}
}
}
}
}