final JGitPathImpl gTarget = toPathImpl( target );
final boolean isBranch = isBranch( gSource ) && isBranch( gTarget );
if ( options.length == 1 && options[ 0 ] instanceof CherryPickCopyOption ) {
if ( !isBranch ) {
throw new IOException( "Cherry pick needs source and target as root." );
}
final String[] commits = ( (CherryPickCopyOption) options[ 0 ] ).getCommits();
if ( commits == null || commits.length == 0 ) {
throw new IOException( "Cherry pick needs at least one commit id." );
}
cherryPick( gSource, gTarget, commits );
} else {
if ( isBranch ) {
copyBranch( gSource, gTarget );